Using ACT, I would like to create a named selection for each face scoped in a point mass

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited June 2023 in Structures

Using ACT, I would like to create a named selection for each face scoped in a point mass

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    The following script can be adapted. A named selection will be created for each face on which a point mass is scoped.

        geometry = ExtAPI.DataModel.Project.Model.Geometry
        mass=geometry.Children[2] #in this example, the mass is the 3rd object under Geometry, hence "Children[2]"
        surfIds=mass.Location
        for i in range(len(surfIds.Ids)):
            NS_SurfId=ExtAPI.DataModel.Project.Model.AddNamedSelection()
            NS_SurfId.Name='NS'+str(i)
            temp_sel=ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
            mylist=[surfIds.Ids[i]]
            temp_sel.Ids=mylist
            NS_SurfId.Location=temp_sel