[Plugin] Make Unique Selected Components v0.4 20110803
-
Right click on component and/or group, or selected components and groups, and "Make All Unique". This will make unique all selected components, and their nested components.make_all_unique.rb
-
Thank you so much for sharing. This will be a favorite.
-
Really useful. Thanks
-
Any chance you could make a plugin to make unique all selected components AND groups.
That would be the most useful plug-in ever!!!!! with how I work in sketchup.If I could help you or you could explain how I would do it.
Thanks!!
-
Groups, by definition, are unique. How would this be helpful?
-
Sometimes groups are NOT unique, if the group's copy hasn't been edited since it was made then it can be seen by Sketchup as two instances of the same group definition ! It's really a 'bug' in Sketchup, because, as you say a group should always have just the one instance. However, in the API to move a group so it's inside another container-group requires you to add an instance of its definition [using defn=group.entities.parent !] and then erase the original group so it appears to have moved into the container-group...
-
OK. So for example I draw kitchen cabinets and I have created a library of cabinets that are made up of both components & groups. Sometimes in the design it is easier to just copy over cabinets and then if there is a change I will fredo stretch them. I have found it is very important to go deep into the cabinets layers and make sure everything is unique or else the cabinets will bug splat sketchup or some part wont stretch properly or else it will stretch other cabinets in other places of the kitchen that where a copy of that cabinet at one point. When I use this plug in it does not go deep enough into the layers of my cabinets to make everything unique. Im guessing that it stops and soon as it hits the first group inside the component. So all the other groups and components deeper in still remain "non" unique.
-
This short 'one-liner' will run 'make-unique' on all groups that need it, in the model.entities and also when nested inside other groups or definitions...
Sketchup.definitions.each{|d|d.instances.each{|i|i.make_unique if d.instances[1]}if d.group?}
Copy/paste into the Ruby Console +<enter> OR make it into a simple method/menu item...
-
Thanks TIG! I will try this out when I get some spare time.
-
@tig said:
Sometimes groups are NOT unique, [...] It's really a 'bug' in Sketchup,
I don't know if is a bug, but it comes in handy... there is a plugin that selects all group copies (and can convert them into components) and I'm sure that is possible only because that groups are recognized as instances.
But, nevertheless this plugin is a treasure! I often need to make unique a component with nested elements and I had to make unique each "child" until now. -
All components are instances of their definition.
All groups are instances of their definition.
Even all images are an instance of their definition.So a 'definition' can be a '.group?' or '.image?'... or more usually a plain olde 'component'.
Only 'components' appear in the Component Browser...Groups are usually expected to be a single instance of their definition.
Sometimes it's possible to have more than one group referring to the same definition - either by copying a group with no subsequent editing or by 'code'.
So then the group's definition has multiple instances, just like a regular component could.
Any code that makes a group into a component [that then appears in the Component Browser] does so irrespective of how many instances of it there are... this is because e.g. the 'group.to_component' code makes that one group's definition into a plain-component definition, and thereby that group converts into an instance of it [and the definition then appears in the Component Browser]... and therefore if there are any other groups referring to that same definition then these are also made into instances of that plain-component definition too... -
Hello! Is there any possibility to preserve a connection between sub-leveled components inside of selection?
Advertisement