General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Scripting Help – Vertices and End Releases

    • joe.lindley
      Subscriber

      I'm looking to create a script to add end releases to a line body model I have imported with many verticies. The default end release is acceptable as a start point, and I will manually select those that need releases changed at a later point. I would like to have the end releases applied across the board automatically rather than add them manually later.  


      I have started by creating a named selection for the vertices:

      with Transaction(True):
          # Create an empty named selection for vertices
          named_selection_vertex = model.AddNamedSelection()
          named_selection_vertex.Name = "Vertices"

      with Transaction(True):
          # Create an empty named selection for vertices
          named_selection_edge = model.AddNamedSelection()
          named_selection_edge.Name = "Edges"

      And follow that up with trying to gather the verticies and edges into their named selections.

      And this is where I stumble as I'm not sure how to call up the vertexes or edges. For bodies etc. i have used datamodelobjectcategory , but they do not exist there. Can i use IGeoVertex in some way? 

      Thanks for your help,

      Joe 


    • Erik Kostson
      Ansys Employee

      Hi

       

      See here how to obtain geometry:

      https://discuss.ansys.com/discussion/1857/how-to-get-geometry-data-from-mechanical-model-via-script

      Any questions post in that forum as it is dedicated for that (scripting).

      All the best

      Erik

    • joe.lindley
      Subscriber

      thats fantastic thank you - sorry for the mis located post! 

    • Erik Kostson
      Ansys Employee

      happy to help.

      anything post there and I will help on the other side.

      Erik

Viewing 3 reply threads
  • The topic ‘Scripting Help – Vertices and End Releases’ is closed to new replies.