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

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
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: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    Answer ✓

    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