Goal: Select a geometry or mesh in the graphics window.
Code for Geometry selection:
# Clear the current selection and select some previously determined Geo IDs ExtAPI.SelectionManager.ClearSelection() mySel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities) mySel.Ids = [17,19,22] #These are the IDs of any geometric entities ExtAPI.SelectionManager.NewSelection(mySel)
Code for Mesh selection:
You might need to be in the wireframe mode to see the selected nodes.
# Clear the current selection and select some mesh nodes ExtAPI.SelectionManager.ClearSelection() mySel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.MeshNodes) mySel.Ids = [1,2,3,4] # These are the IDs of any node entities ExtAPI.SelectionManager.NewSelection(mySel)