Plugin to make all components in model unique?
-
Hi -
Is there a plugin that will make all components unique?
I"m not looking for a fix where I have two different components that share the same name, but I'm looking for something that will make all instances of the same component unique.
-
Hmm, I cant think of one off the top of my head.
It would be a great script for someone to write who is trying to learn ruby....'eh Dan??
-
@chris fullmer said:
Hmm, I cant think of one off the top of my head.
It would be a great script for someone to write who is trying to learn ruby....'eh Dan??
Who? Me?
Agreed. Haha. I'm still working on script #1, which hasn't progressed much for the last few months.
Interestingly, Fredoscale has a utility built in that makes all selected instances of a component unique. TIG also posted a snippet that does the same, but I had a hard time getting it to work.
-
Check out make_components by Matthieu Noblet. It has a minor bug. You have to include a line in the selection
-
Place in plugin folder, open Ruby Console, and type alluinque [enter] in the command window:
def allunique model = Sketchup.active_model entities = model.entities entities.each do |e| if e.is_a? Sketchup;;ComponentInstance e.make_unique end end end
-
Hi Honolulu -
Thanks a million for this script. This is exactly what I needed. It's nice that this isn't recursive, which fits the workflow nicely for what I'm using this for.
I've edited the script slightly, to make it operate on just the selected components. (Chris, you'll be very proud...)
Same instructions for use, but select the components you wish to make unique first, then type "allsunique" into the console and hit enter.
def allsunique model = Sketchup.active_model selection = model.selection selection.each do |e| if e.is_a? Sketchup;;ComponentInstance e.make_unique end end end
Advertisement