[Plugin] Make Unique Selected Components v0.4 20110803

[Plugin] Make Unique Selected Components v0.4 20110803

Postby honoluludesktop » Wed Aug 03, 2011 2:30 pm

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
1
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby Ben Ritter » Wed Aug 03, 2011 5:44 pm

Thank you so much for sharing. This will be a favorite. :ecstatic:
0

Ben Ritter 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby Bob James » Wed Aug 03, 2011 7:11 pm

Really useful. Thanks
0
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby Meph » Fri Mar 02, 2012 5:09 pm

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!!
0

Meph 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby wyatt » Fri Mar 02, 2012 5:44 pm

Groups, by definition, are unique. How would this be helpful?
0

wyatt 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby TIG » Fri Mar 02, 2012 6:21 pm

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...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby Meph » Tue Mar 06, 2012 3:16 pm

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.
0

Meph 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby TIG » Tue Mar 06, 2012 3:56 pm

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...
Code: Select all
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...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby Meph » Thu Mar 08, 2012 8:09 pm

Thanks TIG! I will try this out when I get some spare time.
0

Meph 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby derei » Thu Mar 08, 2012 8:17 pm

TIG wrote: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.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
derei 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby TIG » Thu Mar 08, 2012 9:53 pm

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...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby tetrochuan » Wed May 01, 2013 1:43 pm

hi there,

is that the same "problem" that gives me the bug splat when using stretch on groups and components sometimes!!?

i guess it is?!


would it be hard then to make a plugin which does the following to the workflow..
"make indiviual every copy" unless its a component in the first place?!

it would be a cool addtion to the su workflow if we could that behaviour on and off !!!!!


=)... if i could just code that shizzl myself.. but iam not lucky enough to have the time teaching this stuff myself ...


farewell !
0

tetrochuan 
 

Re: [Plugin] Make Unique Selected Components v0.4 20110803

Postby dem » Fri Jan 27, 2017 9:49 pm

Hello! Is there any possibility to preserve a connection between sub-leveled components inside of selection?
0
User avatar
dem 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: Google Bot, MaxsoelBB and 8 guests

Visit our sponsors: