Script for removing a named selection from another named selection

Bobin John
Bobin John Member Posts: 8
First Comment
edited June 2023 in 3D Design

I have a named selection called FinSurface, however, I would like to subtract symmetry surfaces (which is another named selection) from FinSurface.



  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 300
    First Anniversary First Comment 5 Likes Ansys Employee

    This is a snippet to get the starting items in a group, add to them, then update the NS with the new items. This is for Spaceclaim/Discovery APIs

    GroupName=<Your NS name>
    NewItems = <Your new geom items>
    AllItems = CurrentItems+NewItems
    NamedSelection.Replace(GroupName, Selection.Create(AllItems), Selection.Empty())