Force Body & Face IDs to be identical with parametrised imported CAD

kartik_vijaykumar
kartik_vijaykumar Member Posts: 1 **

I am currently on a automation script where I import a new CAD every cycle of simulation where I replaces Feature references with face or body IDs, Mechanical tends to change the numbering of faces and bodies with CAD. The source of the Parametric STEP File is the same and contain similar identifiers while only having a different dimension.

For Eg.

coordinate_system_86 = DataModel.GetObjectById(86)
selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
selection.Ids = [1442]
coordinate_system_86.OriginLocation = selection

*the above script was recorded from GUI actions

Also sometimes for the same CAD model the ID is not the same in a different session. Is there a way to force ansys to maintain IDs?

Answers

  • James Derrick
    James Derrick Administrator, Employee Posts: 303
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    Hi @kartik_vijaykumar thanks for your question, which product are you working with here?

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 385
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    This is for mechanical.
    The bottom line issue is internal geometry entity. IDs are not stable, even with small geometry changes. They are therefore not recommended for the method of scoping for these types of workflows.
    Instead, utilize named selections for scoping that either come From the upstream, CAD tool, or are created by stable logical methods via named selection worksheets.
    Since this is a scripting forum, we can also utilize python code objects for python scripting to do Even more advanced logic and trigger these on geometry and/or mesh update callbacks