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?