Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(API) - Meshing panels problem

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
vitor_monteiro_ext
168 Views, 2 Replies

(API) - Meshing panels problem

Dear forum colleagues,

I am trying to mesh my panels with Coons and 0.05 element size. 

However, after running the codes, none of my meshing options are introduced in my FE model. Maybe, I am not getting the panels correctly. Does someone can help me with this issue?

 

Thank you in advance.

 

Regards.

 

 

Sub MESHING_FEM()
    Dim PanelSel As RobotSelection
    Set PanelSel = RobApp.Project.Structure.Selections.Get(I_OT_PANEL)
    PanelSel.FromText "1 2 3 4 5 6"
    Dim PanelCol As RobotObjObjectCollection
    Set PanelCol = RobApp.Project.Structure.Objects.GetMany(PanelSel)
    Dim obj As IRobotObjObject
    For i = 1 To 6
        Set obj = PanelCol.Get(i)
        obj.Main.FiniteElems
        obj.Mesh.Params.MeshType = I_MT_NORMAL
        obj.Mesh.Params.SurfaceParams.Coons.PanelDivisionType = I_MPDT_SQUARE_IN_RECT
        obj.Mesh.Params.SurfaceParams.FiniteElems.Type = I_MSFET_4NODE_QUADRIL
        obj.Mesh.Params.SurfaceParams.Generation.Type = I_MGT_ELEMENT_SIZE
        obj.Mesh.Params.SurfaceParams.Generation.ElementSize = 0.05
        obj.Mesh.Generate
    Next i
    Set obj = Nothing
    Set PanelSel = Nothing
    Set PanelCol = Nothing
End Sub

 

2 REPLIES 2
Message 2 of 3

hi @vitor_monteiro_ext 

I recommend that you update your object after adjustments and generate the mesh then.

Stephanekapetanovic_0-1721367514012.png

instead of meshing one element after the other, I suggest you mesh them all together. the junctions will be better and your code will be simpler.

 

Sub MESHING_ALL_FEM()
  Dim RobApp As IRobotApplication: If NotReady(RobApp) Then Exit Sub
  Application.DisplayAlerts = False
  With RobApp.Project.Structure.Objects.Mesh
    With .Params
      .MeshType = I_MT_NORMAL
      With .SurfaceParams
        .Coons.PanelDivisionType = I_MPDT_SQUARE_IN_RECT
        .FiniteElems.Type = I_MSFET_4NODE_QUADRIL
        .Generation.Type = I_MGT_ELEMENT_SIZE
        .Generation.ElementSize = 0.05
      End With
    End With
    .Generate
  End With
  Application.DisplayAlerts = True
  Set RobApp = Nothing
End Sub

 

this code can generate a long wait, messages will not be displayed. You can also make sure Excel supports long-running OLE execution

Best Regards

Message 3 of 3

Thank you @Stephane.kapetanovic. It worked smoothly.

 

Best Regards.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report