We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Name selection script

    • Shyam Prasad V Atri
      Subscriber

      Is it possible to create a named selection with python script? (I have to create an individual name. I cannot avoid that. Please let me know if i can create it with a script)

       

    • Shyam Prasad V Atri
      Subscriber

      Can you do the nameing through space claim python script? If so how do i select an existing circle ? where can i get the edge numbers to make the selection?

    • Shyam Prasad V Atri
      Subscriber

      I dont want to use the GUI.

      I am able to generate a script that can do edge selectionand create a named selection as a group. but i don't know how to identify the edge pairs

       

      Is there any way to export the edge index from space claim? edge coordinates and the ID of the edge

      I see in documentation that you mention there is a ID file. I cant seem to find this id file anywhrere.

       

       
    • Aniket
      Forum Moderator

      Where do you want to create this named selection? And what is the common thing in these edges? Do they have same length? Have you tried worksheet based approach?

      -Aniket

      How to access Ansys help links

      Guidelines for Posting on Ansys Learning Forum

    • Shyam Prasad V Atri
      Subscriber

      what is a worksheet-based approach? are you referring to excel?

      I had to add the screenshot of the code because without that there is no way i could give context. 

      making it in excel is a very tedious process considering the scale of the model if space claim can somehow give me a log of the edge ID's that would make it so much easier to create the named selections.

      where can i find the ID map ? or Where in space claim can i display edge ID's?

       

    • Aniket
      Forum Moderator

       

      No, I did not mean excel by using a worksheet. In Mechanical, you can create a worksheet based named selection. For example, for edges, working with ids would be cumbersome if the IDs are changing due to parametric changes in the geometry. Instead, one can use different geometry parameters such as edge length, location, etc

      For more information please check:

      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/wb_sim/ds_NS_Criteria.html

      -Aniket

      How to access Ansys help links

      Guidelines for Posting on Ansys Learning Forum

       

    • Shyam Prasad V Atri
      Subscriber

      This is not a helpful method for me. I am trying to create a named selection. not use any created named selection. it would be easier for me to create based on the edge id. Even if it changes if i put it in a python script it will not matter then. If there is any script command that will create based on vertex then that will be helpful. but i don't see such a command.

      So please tell me if there is any way of getting the edge ID in a file.

    • Shyam Prasad V Atri
      Subscriber

      For example in a sample geometry i know that 127 is the limit of the edge number so i can terminate the loop there

      i=7
       
      while(i<127):
          # Create Named Selection Group
          primarySelection = EdgeSelection.Create([GetRootPart().Bodies[0].Edges[i],
              GetRootPart().Bodies[0].Edges[i+1]])
          secondarySelection = Selection.Empty()
          result = NamedSelection.Create(primarySelection, secondarySelection)
          # EndBlock
          i=i+2
       
      This was slightly simple for me. but when i scale it more say i go to 1000 i may not know what is the limiting number
Viewing 7 reply threads
  • The topic ‘Name selection script’ is closed to new replies.