Discovery Import

Discovery Import

How to get the body name by surface name in Discovery AIM by python

    • sjyu
      Subscriber

      Hi, I want to use command to operate the body in AIM(such as assign material for "BODY 2"). and what I have is the selection set  of surface(such as "selectionSet2").

      So how can I get the body name by this surface selection set or some surface?

      Thanks!

    • Naresh Patre
      Ansys Employee

      Hello Frank

      I will have to check it.

    • Naresh Patre
      Ansys Employee

      Hello Frank

      Please refer below code:

       

      model = Study.GetModel(Name="Model 1", Container="Study")

      allss=Study.GetAllSelectionSets()  # access all selection sets

      loc = allss[0].Location   # access face of1st selection set ("Selection Set 1")

      print loc

      parentBody = Study.GetEntityBodies(TopologyString=loc[0], Model = model)  # access parent body of face

      print parentBody

      • sjyu
        Subscriber

        Naresh Patre thank you very much!

        it is workable.

        How can I find this function by myself(like function: GetEntityBodies)? Is there some API reference for AIM?

        Thanks!

    • Naresh Patre
      Ansys Employee

      Hello Frank

      Several functions of "Study" object are described in Help document under Customization Suite 2019 R2 - ANSYS AIM and Workbench Scripting Guide - Data Containers - Study. However, functions like GetEntityBodies are not mentioned. But you get get a list of all functions under Study object by executing dir(Study) command.

      • sjyu
        Subscriber

        Naresh Patre thank you  very much!

Viewing 3 reply threads
  • You must be logged in to reply to this topic.