Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

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

Specify NamedSelection as geometry for Layered Section with ANSYS ACT

    • peter.greaves
      Subscriber

      I have a script to set up my model and part of this should involve using a named selection (which came through from SpaceClaim) as the geometry for where a layered section is used. I can't find out how to use a named selection as an iSelectionInfo which is what the Location needs. I'm after something like this:

      laySect = Model.Geometry.AddLayeredSection()

      selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)  # Create an empty selection.
      selection.Entities = ?  #  How to use the named selection as the Entities?
      laySect.Location = selection

      Any help will be much appreciated!

       

       

    • ErKo
      Ansys Employee

       

      Say the named selection is called “MyBodyNamedSelection”
      Sample code:

      laySect = Model.Geometry.AddLayeredSection()

      ExtAPI.SelectionManager.ClearSelection()
      ns = ExtAPI.DataModel.GetObjectsByName(“MyBodyNamedSelection”)
      laySect.Location = ns[0]

       

      • peter.greaves
        Subscriber

        That's done the trick, thanks!

    • ErKo
      Ansys Employee

      happy to help.

Viewing 2 reply threads
  • The topic ‘Specify NamedSelection as geometry for Layered Section with ANSYS ACT’ is closed to new replies.
[bingo_chatbox]