Duplicate a mesh sizing and change some settings in duplicated sizing

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 867
500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
✭✭✭✭
edited June 2023 in Structures

How can I duplicate a mesh sizing and change some settings in duplicated sizing through ACT scripting?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 867
    500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
    ✭✭✭✭
    Answer ✓

    The example below duplicates a mesh sizing and changes the coordinate system used to define the position of the sphere of influence for the duplicated sizing:

    initialSizing = ExtAPI.DataModel.Project.Model.Mesh.GetChildren(DataModelObjectCategory.Sizing,True)[0] # get first object "sizing" in the tree
    initialSizingCS = initialSizing.SphereCenter # access CS used for sphere center
    initialSizingCS.Name # check CS name
    newSizing = initialSizing.Duplicate() # duplicate sizing
    selectCS = ExtAPI.DataModel.Project.Model.CoordinateSystems.Children[1] # reference a new CS 
    newSizing.SphereCenter=selectCS # use "selectCS" as sphere center CS for new sizing