Bulk Layer Change on Folder of Components
-
I have a folder of dozens of components that are on 2 separate layers. I would like to be able to process them to change each layer name to match a new template that I will be using.
Anyway to do this in bulk without having to edit each one?
Ex. Layer Name --> New layer name
02IR - Heads ---> 4.2 IR Heads
02IR3 - Spray Patterns --> 4.2 Spray Pat
02IR2 - GPM --> 4.2 IR Heads GPM -
Do you mean you want to change the names of the tags assigned to the components in your collection? You could insert all of those components into a single model, edit the tag names as desired and then save the components as a new local collection.
FWIW, SketchUp doesn't have Layers anymore and nothing in SketchUp was ever put "on" a layer when it did. Layers, and now Tags are given to or put on objects.
-
As Dave R says you could do it manually 'once' and be done, or if you're up to dabbling in Ruby...
There are several 'batch/bulk' scripts around, e.g. my own
https://sketchucation.com/pluginstore?pln=TIG-batchpurge
It'd be relatively straightforward to redo the code to open each of the SKPs in the chosen folder in turn and then instead of purging them, rename layers [tags] based on a look up hash list like this...rename_hash={ "02IR - Heads" => "4.2 IR Heads", "02IR3 - Spray Patterns" => "4.2 Spray Pat" ### etc }
then something like:
rename_hash.each_pair{|key,value| if layer=Sketchup.active_model.layers[key] layer.name=value end }
Save the SKP and do the next one etc...
-
Awesome! Thanks to both of you! The manual version is immediately helpful as a short term solution, but I really appreciate the discussion of the ruby. That might be incredibly helpful in the future.
Take care
Advertisement