Remove all instances of a component?
-
This should remove all of the instances of a component named 'RivetName'
Sketchup.active_model.definitions["RivetName"].instances.each{|e|e.erase!}
Just add the actual name of the Component you want to erase!
Then purge-unused components later as desired...If your 'Rivet' is too complex... BUT you'd like to retain it in some much simpler form... then edit an instance and make it much simpler and being a component all instances will change to match...
-
You can also always right click on a component thumbnail in the component browser > In model and delete it. TIG cannot think out of ruby any more.
-
Csaba !
that is very true!
BUT my edit and simplify ideas does still stand -
Ah sure. Also, if these things are inside other components, editing one of those and deleting would delete all instances, too.
-
Thanks gentlemen. I actually thought about the delete from the component browser but thought that would be too easy and it would probably be more complicated than that. Also since I'm not that organized with my components, I can see the script coming in handy also.
-
When you right-click on a selected component , in the context menu choose "instances", "select all".
Edit: I thing this comes with TT selection toys
http://forums.sketchucation.com/viewtopic.php?t=14975#p114380 -
Yes, that's a plugin. Sometimes I also forget what is native SU and what is a plugin.
(Great plugin BTW).
-
@gilles said:
When you right-click on a selected component , in the context menu choose "instances", "select all".
Edit: I thing this comes with TT selection toys
http://forums.sketchucation.com/viewtopic.php?t=14975#p114380Not quite. A plugin isn't required. If it's not already open, just open the Components window (Window->Components). Select the "In Model" components. Right-click on the desired component and choose "Select Instances". Then, press the Delete key.
-
That's what I also mentioned above:
http://forums.sketchucation.com/viewtopic.php?p=368127#p368127However that context menu item gilles mentioned comes with the plugin.
-
@unknownuser said:
Not quite. A plugin isn't required. If it's not already open, just open the Components window (Window->Components). Select the "In Model" components. Right-click on the desired component and choose "Select Instances". Then, press the Delete key.
Well that true I tried it but it does not select nested components, TT selection tool does.
-
That's true. You can even play around with it. Select a bunch of nested (and mirrored and scaled) instances and start rotating or moving them. Really funny.
-
@calypsoart said:
I'm working on a project that has a lot of metal and truss work. I may have put in too much detail, and the model is bogging down my machine. I'd like to reduce the load. I was wondering if there is some way to remove all instances of a component. E.g I put in rivets for the joints in the steelwork. In reality, these are invisible for most views unless zoomed way in. I could remove these rivets/components and it would not be noticed. Is there a plugin that might remove or allow me to swap out a complex component for a simpler one?
Component swapping is built-in - no need for a plugin.
Select the component and right-click. Select Save As... from the menu and save it a place where you'll find it (like where your scene is?).
Then you could "rebuild" your rivet to a single line (that could even be invisible), or some simple shape.
If/when you later find out that you need the rivets again, you just select one of the stand-ins, right-click and Reload... it. But before you do, save your simple rivet as Rivet_simple or something, so it is easy to get it back later.
Very convenient when building complex scenes - like with hundreds of 3D trees, cars, rivets or similar..
Just model very simple components and Reload more complex versions later when needed.
Advertisement