I need to batch rename, actually add a prefix, all layers and sublayers names of some files keeping layer ordering and layer::sublayer::subsublayer structure intact.
I found already some posts about this but did not manage to work for me:
Running Rhino v7, maybe I get errors because scripts were developed for v5/6?
I am not that into RhinoScript, Python or Grasshopper so any help is much welcome!
It is more a question of many layers than many files so manually opening a single file, performing the script and saving it individually is fine.
Many Thanks!
Hi @Helvetosaur
I need to add a prefix to all layers, sublayers, subsublayers…
I currently export my 3DM file to STP trough SpaceClaim which convert layers, sublayers to parts, subparts structured according to original Rhino hierarchy. See attached screenshot about this.
This way it is possible to export Rhino geometry to any solid modeler maintaining layers and their hierarchy.
When a Solid modeler import a STP which has parts generally create a single file for any part (ex-Rhino layer). If parts have same name, even across different files, issues may happen.
I need to add a prefix to any layer, sublayer (part, subpart) to uniquely identify them
Right now there is no separator programmed between the typed-in prefix and the layer name. If you wish to have a separator like a dash or underscore, open the script in a text editor and change the following line:
sep=""
to (for example a dash)
sep="-"
i.e. just put the desired separator between the quote marks. Then resave the file and close it.
Hi Andrew,
could you modify the script to change some layers into sublayers? (using fullpath)
Example:
currLayerName = Layer1
newLayerName = Layer0::Layer1