I'm trying to create a named selection in Ansys Mechanical. The face id's are given. But I don't know how to use the CreateSelectionInfo Method. According to API Documentation I should pass SelectionTypeEnum.GeometryEntities but I don't know how to import this Enum. How is the workflow to create a named selection with pyansys?
# Initialize the Mechanical app
app = App()
globals().update(global_variables(app))
ExtAPI = app.ExtAPI
model = ExtAPI.DataModel.Project.Model
selection_manager = ExtAPI.SelectionManager
selection = selection_manager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities) # Here is my problem because I can't import SelectionTypeEnum...
selection.Ids = [1,2,3,4] # id's are given.
# create named selection. Not sure if this is correct.
ns = model.AddNamedSelection()
ns.set_Location(selection)
ns.set_Name("Test NS")
ns.Generate() # is this necessary?
Thanks!