-
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! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @SRO-RF The site is here. There seems to be a similar question/answer here. Mike |
Beta Was this translation helpful? Give feedback.
Hi @SRO-RF
PyMAPDL is not WB Mechanical scripting...nd very much different! I would suggest you ask your question on the Ansys Developers Forum, which is open to the public. We can ask generic scripting and/or product specific scripting questions there.
The site is here.
There seems to be a similar question/answer here.
Mike