Community
Hi Rafal,
How can I get a homogeneous Finite Element thickness by Robot API?
Thanks
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Example how you create such label also with kz:
thick_name = "Panel th with KZ" Dim Label As RobotLabel Set Label = robapp.Project.Structure.Labels.Create(I_LT_PANEL_THICKNESS, thick_name) Dim ThickData As RobotThicknessData Set ThickData = Label.Data ThickData.ElasticFoundation = 10000 ThickData.ThicknessType = I_TT_HOMOGENEOUS ThickData.MaterialName = material_name Dim HomoThickData As RobotThicknessHomoData Set HomoThickData = ThickData.Data HomoThickData.Type = I_THT_CONSTANT HomoThickData.ThickConst = 0.3 robapp.Project.Structure.Labels.Store Label
If it is homogenous thickness you do not need to get it for each FE (in fact you can get panel th label assigned to each FE).
Take it from panel - faster = once per panel
Example code for every Fe
Dim RSelection As RobotSelection Set RSelection = RobApp.Project.Structure.Selections.Get(I_OT_PANEL) Dim PanelCol As RobotObjObjectCollection Set PanelCol = RobApp.Project.Structure.Objects.GetMany(RSelection) For ii = 1 To PanelCol.Count Dim obj As RobotObjObject Set obj = RobApp.Project.Structure.Objects.Get(PanelCol.Get(ii).Number) Dim FEs As String FEs = obj.FiniteElems Set RSelection = RobApp.Project.Structure.Selections.Create(I_OT_FINITE_ELEMENT) RSelection.FromText (FEs) Dim FECollection As RobotFiniteElementCollection Dim FE As RobotFiniteElement Set FECollection = RobApp.Project.Structure.FiniteElems.GetMany(RSelection) Dim THLabel As RobotLabel Dim THData As RobotThicknessData Dim HomoThickData As RobotThicknessHomoData For i = 1 To FECollection.Count Set FE = FECollection.Get(i) If FE.FeType = I_FET_T3 Or I_FET_Q4 Then Cells(12 + i, 3) = FE.Number Set THLabel = FE.GetLabel(I_LT_PANEL_THICKNESS) Set THData = THLabel.Data If THData.ThicknessType = I_TT_HOMOGENEOUS Then Set HomoThickData = THData.Data Cells(12 + i, 4) = HomoThickData.ThickConst End If End If Next i Next ii
I am using Robot SDK 2021 version:
The output of .Get(_) below is not RobotObjObject but RobotDataObject.
Can you please help me how to get the output as datatype RobotObjObject.
i am create contours in my project.
Dim obj As RobotObjObject Set obj = RobApp.Project.Structure.Objects.Get(PanelCol.Get(ii).Number)