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.

Tagged:

Answers

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 327
    25 Answers First Anniversary 100 Comments 25 Likes
    ✭✭✭✭

    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>
    CurrentItems=list(Selection.CreateByGroups(GroupName).Items)
    NewItems = <Your new geom items>
    AllItems = CurrentItems+NewItems
    NamedSelection.Replace(GroupName, Selection.Create(AllItems), Selection.Empty())