Find and change characters for Named Selections inside Spaceclaim

Member, Moderator, Employee Posts: 311
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited November 2023 in 3D Design

Say we have a some Named Selections inside Spaceclaim with the "." character inside their name.

We would like to replace this character by "_".

Can we use scripting to do that?

Comments

  • Member, Moderator, Employee Posts: 311
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited November 2023

    Below is a Spaceclaim script that finds . in the groups/Named Selections, and replaces it with _

    1. groups = GetActiveWindow().ActiveWindow.Groups
    2. for ns in groups:
    3. nm=ns.GetName()
    4. if nm.find(".") !=-1:
    5. print(nm)
    6. newnm = nm.replace(".", "_")
    7. NamedSelection.Rename(nm, newnm)
This discussion has been closed.