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: 

Creation of Panel with FE list using API

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
998 Views, 4 Replies

Creation of Panel with FE list using API

Hi,

 

Using the API with C# I have created a list of Finite elements, and now wish to merge these into a panel. This can be done in the UI but I can't figure out how to do it with the API. 

 

Thanks,

Mike

Tags (2)
4 REPLIES 4
Message 2 of 5
Rafal.Gaweda
in reply to: Anonymous

Example code creates 1FE panels from existing meshed panel

Modify it

 

    Dim RSelection As RobotSelection
    Set RSelection = RobApp.Project.Structure.Selections.CreateFull(I_OT_FINITE_ELEMENT)
    
    Dim FECol As RobotFiniteElementCollection
    
Dim Collection As RobotNumbersCollection
Set FECol = RobApp.Project.Structure.FiniteElems.GetMany(RSelection)

Dim OD As RobotObjObject
Dim PT As String
Dim RT As String
Dim CM As String

For i = 1 To FECol.Count
   Set OD = RobApp.Project.Structure.Objects.Get(FECol.Get(i).ObjectNumber)
   PT = OD.GetLabelName(I_LT_PANEL_THICKNESS)
   RT = OD.GetLabelName(I_LT_PANEL_REINFORCEMENT)
   CM = OD.GetLabelName(I_LT_PANEL_CALC_MODEL)
   
    Set Collection = RobApp.Project.Structure.Objects.CreateOnFiniteElems(Str(FECol.Get(i).Number), 100000 + i)
    RobApp.Project.Structure.Objects.Get(Collection.Get(1)).SetLabel I_LT_PANEL_THICKNESS, PT
    RobApp.Project.Structure.Objects.Get(Collection.Get(1)).SetLabel I_LT_PANEL_REINFORCEMENT, RT
    RobApp.Project.Structure.Objects.Get(Collection.Get(1)).SetLabel I_LT_PANEL_CALC_MODEL, CM
Next i

 

 



Rafal Gaweda
Message 3 of 5
Anonymous
in reply to: Rafal.Gaweda

Hi!

 

Do you have a similar example but for creation panels based on list of objects, not FE?

 

Thank you,

Gabi

Message 4 of 5
Rafal.Gaweda
in reply to: Anonymous

There in no such method in API

 

robapp.Project.Structure.Objects.Create*

 

So either use CreateCountour using RobotPointsArray

or create contour like in this example (also Panel properties are assigned in the code below)

 

Sub Plaque_Robot()

' stockage des points des contours des panneaux

    tableau_point_int(1).X = 0#
    tableau_point_int(1).Y = 0#
    tableau_point_int(1).Z = 0#

    tableau_point_int(2).X = 20
    tableau_point_int(2).Y = 0#
    tableau_point_int(2).Z = 0#

    tableau_point_int(3).X = 21
    tableau_point_int(3).Y = 10
    tableau_point_int(3).Z = 0#

    tableau_point_int(4).X = 1
    tableau_point_int(4).Y = 10
    tableau_point_int(4).Z = 0#

 ' ***** elements Robot *****
    Dim monobjet As RobotObjObject
    Dim moncontour As New RobotGeoContour
    Dim monsegment() As New RobotGeoSegmentLine

 ' **************************
    
    Dim i As Long
    
   'contour carré donc 4 segments
      ' définition des segments
      ReDim monsegment(1 To 4)
        For i = 1 To 4

        monsegment(i).P1.Set tableau_point_int(i).X, tableau_point_int(i).Y, tableau_point_int(i).Z
        ' initialisation des contours
        moncontour.Add monsegment(i)
        Next
        
        
        moncontour.Initialize
        
        'création de l'objet panneau
        Set monobjet = robapp.Project.Structure.Objects.Create(1)
        monobjet.Main.Geometry = moncontour
        monobjet.Main.Attribs.Meshed = True    ' Demande si le maillage doit ętre généré sur l'élément objet
        monobjet.Main.Attribs.DirZ = 0              ' axe local
        monobjet.Main.Attribs.SetDirX I_OLXDDT_CARTESIAN, 1, 0, 0  ' axe local
        
        
        monobjet.Initialize                    ' The function initializes internal data on the basis of the data defining the object. .
        monobjet.Update                        ' mise ŕ jour de l'objet

' maillage
monobjet.Mesh.Params.MeshType = I_MT_USER
monobjet.Mesh.Params.SurfaceParams.Method.Method = I_MMT_COONS
monobjet.Mesh.Params.SurfaceParams.Generation.Type = I_MGT_ELEMENT_SIZE
monobjet.Mesh.Params.SurfaceParams.Generation.ElementSize = 0.5
monobjet.Mesh.Generate

   ' définition du matériau
        Material_Name = "BETON" ' & Str(fc28)
        Set mat = robapp.Project.Structure.Labels.Create(I_LT_BAR_MATERIAL, Material_Name)
        Dim matdata As RobotMaterialData
        Set matdata = mat.Data
        matdata.Type = I_MT_CONCRETE
        matdata.E = 11000 * 30 ^ (1 / 3) * 1000000          '         matdata.E = 11000 * fc28 ^ (1 / 3) * 1000000
        matdata.NU = 0
        matdata.RO = 24530
        matdata.Kirchoff = matdata.E / (2 * (1 + matdata.NU))
        matdata.LX = 0.00001
        matdata.RE = 30 * 1000000                           '         matdata.RE = fc28 * 1000000
        robapp.Project.Structure.Labels.Store mat  ' Function saves the cut under the specified name sauvegarde des paramčtre sur le nom spécifique
        
   
    ' definition de l'épaisseur

    thick_name = "EP 30"
    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 = 0        ' appui elastique : ThickData.ElasticFoundation = coefficient_raideur * 9.81 * 1000
    ThickData.ThicknessType = I_TT_HOMOGENEOUS
    ThickData.MaterialName = Material_Name
    Dim HomoThickData As RobotThicknessHomoData
    Set HomoThickData = ThickData.Data
    HomoThickData.Type = I_THT_CONSTANT
    HomoThickData.ThickConst = 30 / 100
    robapp.Project.Structure.Labels.Store Label
    monobjet.SetLabel I_LT_PANEL_THICKNESS, thick_name
    Set Label = Nothing

    moncontour.Clear
    
    Set monobjet = Nothing
    Set moncontour = Nothing
    ReDim monsegment(1 To 1)
    Set monsegment(1) = Nothing
   
End Sub

 

 

 



Rafal Gaweda
Message 5 of 5
Rafal.Gaweda
in reply to: Rafal.Gaweda

Gabi,

 

HINT: using BeginMultiOperation and EndMultiOperation in certain parts of code speeds up  (several times) process of creating contours.

Example in http://forums.autodesk.com/t5/Autodesk-Robot-Structural/API-objects-geometry-to-triangles-converter/... in project source code.



Rafal Gaweda

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

Post to forums  

Autodesk Design & Make Report