Script for automatically selecting elements and defining a new named selection


I was wondering if there is a script for defining the named selection automatically. I have a 2-D model and need to define different sets in named selection for different part of it. I do it manually right now but with any change in the upstream calculation the elements in the name selections vanish. May be it is possible to define the sets by giving the coordinates in a script and then give it a name. Could somebody help me please. Thanks!


  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 308
    First Anniversary First Comment 5 Likes Ansys Employee

    Yes you can do this. You can record the UI actions via the scripting console recording feature.
    You can also use worksheet based scoping for the named selection. It may mean you don't need to do any scripting if it is simple. You can finally use them both as you can use the pythonic API to automate the worksheet logic as well.

  • Z.Boe
    Z.Boe Member Posts: 3
    First Comment

    Thank you Mike. I used both the recording and worksheet and it worked!