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
Solved! Go to Solution.
Solved by Stephane.kapetanovic. Go to Solution.
I recommend that you update your object after adjustments and generate the mesh then.
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
Can't find what you're looking for? Ask the community or share your knowledge.