Select ALL component instances to memory buffer.
-
@rv1974 said:
The subject is constantly badly needed. I'm talking about all instances (even deeply nested in other groups\comps. There's already some ruby 'select all instances' but it's not comprehensive- it does not copy all the stuff (only entities on current hierarchy level).
Thanks in advance.i don't experience this problem
when i right clic on a component, choose "select all instances", even the instances embedded in groups of other components, are selectedthere seems to be at least 2 plugins doing this
and
the one i use is the Smustard R WILSON's
-
Huge thank!
It appears I had the outdated version of the first link. -
Selection Toys let you select everything.
-
-
@rv1974 said:
The stuff does not enter the memory buffer! (though it indeed get selected).
Wait, it it gets selected, but that is not what you mean by "memory buffer"?
-
OK.. you select them (at this stage everything is OK, all instances are highlighted); now do Cntl+C and then paste 'em say in a new file.. Nada!
Only a small portion get pasted- not the whole number of instances. -
@rv1974 said:
OK.. you select them (at this stage everything is OK, all instances are highlighted); now do Cntl+C and then paste 'em say in a new file.. Nada!
Only a small portion get pasted- not the whole number of instances.2 components
2 instances A1 et A2 of the same component
1 instance B of another componentA1 and B form a group
i clic on A2, "select all instances"
A1 and A2 are selected
control+C
new file
copy in place
i do get the 2 instances A1 and A2, but they are not in the same place they were in the previous file
son even if i get all the instances, there is a bug, yes
-
You can't simply Edit>Copy then Edit>Paste Selected objects leaving them within multiple contexts.
Doing it manually you can only ever Select objects in the same active_entities context.
So after you Copy you will always Paste those into the current context [active_entities]...Selecting all instances in code, when some are nested in other contexts, still allows you to do this Copy and then Paste, BUT ALL of the new instances will be put into the active_context, ignoring their original context[s]... just like when you do it manually within one context at a time.
Also the transformations of the individual instance's containers is ignored in the replication...BUT it would be possible to mimic a copy+paste leaving all copies in the same contexts as their originals... by duplicating all instances in their own container's entities - but using Ctrl+C will never work across contexts...
It would be complicated to do as each instance and each container can have its own transformation, and the instances layers, materials etc... etc...But it's not impossible...
May I ask WHY you need to do this ?
-
@tig said:
But it's not impossible...
May I ask WHY you need to do this ?
It's crucial in my workflow. I typically need to swap SU components (tons of precisely placed entourage) with Max's vray proxies. In simplifiedexample attached above, I needed to swap SU spotlights with Max lights. Now (when there's still no solution for effortless grabbing I have to do lots of manual (which tends to be erroneous) exploding and messing with temporal files.
-
If you simply want to 'swap' components leaving them where they are, then you don't need to 'select' them at all...
Let's say you have definition 'A' with several instances spread across different contexts.
Let's say you want them all to become instances of definition 'B'.
This one liner should achieve that:d=Sketchup.active_model.definitions;d['A'].instances.each{|i|i.definition=d['B']}
Make two different looking components 'A' and 'B' and place several instances of each in various contexts... Use the Ruby Console and Copy+Paste+<enter> the code above... ALL instances of 'A' should become 'B' - even ones NOT in the active_entities current context
-
this is what I constantly do (if I understood correctly your suggestion) via Fredo's ghost components.
But yhe ultimative task is to gigg all the desired instances out of their contexts and put them above. -
So if I understand you correctly now...
You now want to 'move' [or perhaps copy?] all of a definition's instances from whatever context they are in into the current context [active_entities] ??
AND I must suppose maintain there relative transformations ?
Otherwise it could be done already - but with insertion-points messed up !This is not a trivial task.
As you realize doing it manually Edit>Copy [OR Cut] when a selection spans several contexts gives odd results when Pasted - if the containers have been transformed in any way - the Pasted instances are located relative to the origin of their container, which is then combined into the current context using its origin which might not be the same ! -
So I just came across this thread looking for a similar solution...
I have a bunch of components that are spread throughout my model. The components are at different levels of the model. I can use TT's "Select all instances" select them all, no matter how deep they are buried in other components.
What I'd like to do is to be a be able to "copy" (ctrl C) the components and then paste (ctrl V) ALL of the components somewhere else (like in the context of another component)
Is this possible with a plugin or some snippet of code? It seems very similar to this request, the only real difference is that I'm trying to copy these components into whatever instance I want, I just want to retain their location...
-
Jim brilliantly* solved this already.
Very valuable, but the author didn't bother to put it in the Store (as well as 'save as previos version')
https://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=33441%26amp;start=30
jf_save_instances.rb
9th post from the bottom.
*Currently it's 2-step procedure. I wish someday it will be one-click solution.
Advertisement