Search & Replace Name
-
Has anyone come across a Search & Replace plugin for component/group names?
I've got a scene with dozens of objects that need to shift from one # to another # -- it's a real bear going in and doing it manually for all the objects.
-
Im not sure if it's what your looking for, but if you go to the components window and right click a component there is a 'select instances' (find) option and a 'replace selected' (replace) option.
-
Yeah, I knew about how to replace physical components -- I was looking for a way to rename components. So if I have MyComponent_AB YourComponent_AB in the Outliner, I could rename the _AB to _YZ. Now they'd be called MyComponent_YZ and YourComponent_YZ.
-
So you did
-
Are you familiar with regular expressions?
azuby
-
Open the Outliner and Entity-Info windows and dock them together.
Select the Component Instance in question in the Outliner and its Definition-Name AND Instance-Name appear in the Entity-Info window.
Edit these as desired.
Changing the Definition-Name will globally rename the Definition. Each Instance can have its own name too...
However, if you want to replace parts of names within a set of several definitions' names [like "AB" with "XY"], then to do this globally you need something this:### this does all definitions' AND instances' names; edit 'text_go=/text_in=' to suit... text_go="AB";text_in="XY";Sketchup.active_model.definitions.each{|defn|defn.name=defn.name.gsub(text_go,text_in);defn.instances.each{|inst|inst.name=inst.name.gsub(text_go,text_in)}} ### remove the defn.name... part to leave them alone OR remove the defn.instances... part to leave them alone...
I'll leave you to make the app/menu etc...
Advertisement