How can I use a script to delete a named selection?

sunyroy
sunyroy Member Posts: 11
First Comment Name Dropper
**


thinks!

Answers

  • Rajesh Meena
    Rajesh Meena Moderator, Employee Posts: 125
    100 Comments Second Anniversary 5 Answers Solution Developer Community of Practice Member
    ✭✭✭✭
    disp_ns =[ns for ns in ExtAPI.DataModel.GetObjectsByType(DataModelObjectCategory.NamedSelection) if ns.Name=="Displacement"]
    
    for ns in disp_ns:
        ns.Delete()
    
  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 366
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Also for a single line without for loop (more efficient)
    ExtAPI.DataModel.Remove(disp_ns)