I am looking for a Python script to search the first three characters of layernames in Rhino V7 for a prefix (e.g E86--------) and replace it with another three character prefix (e.g. F90---------)
So before the script runs I would see:
v Profiles
E86001 first profile
E86002 second profile
E86003 third profile…
E86---- etc…
After the script runs I would see
v Profiles
F90001 first profile
F90002 second profile
F90003 third profile…
F90---- etc…
In some cases there are layers with sub layers that have their own sub-sub-layers
e.g.
v Profiles
E86001
E86001PVT
E86001SLT
E86001FXG
I did find a script AT ThiS link but it does not search and replace and appears to only
add a prefix to all layers and sublayers?
Many thanks for your prompt response.
Tried your excellent script out on a test file with 68 changes in layers, sub-layers and sub-sub-layers and it worked fine !
Maybe something that should be added into the base Rhino commands at some stage ??
It would be very usefull where a range product designs have various sizes or thicknesses. The component layers can be duplicated for each range and the layers updated to reflect the size or thickness of the component.