[Plugin] Originate component axes
-
Request originally posted by Gaieus.
@gaieus said:
Is there something that would move the component origins of all components in the model/selection to the world origin?
Yes, I know this would not work with models where there are several instances of the same component so I guess either in this case or just to make it simple and safe, every case all affected components should be made unique.
Also, ideally only top level components should be affected.
Here's a quick script to put into Plugins folder and restart SUp...
TIG (c) 2012
All Rights Reserved.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.TIG-originatecomponentsaxes.rb
Usage:
Preselect some Component-Instances [other things are ignored].Ruby Console: TIG::originatecomponentsaxes()
Tool Menu: TIG::originate components axesThe component definitions are made unique if needed, then adjusted so that
their axes [insertion-point] is at the model-origin and the transformations
of their instances are inverted so the instances do not move...Donations:
By PayPal.com to info @ revitrev.org ###
Version:
1.0 20120228 First Issue. -
I guess you saw "Axis component" by sahi. (in Plugins Index) This only helps set axes within the components as far as I know, and probably only one by one.
-
This one liner copy/paste + <enter> into the Ruby Console will move the insertion points [axes] of all selected instances to the origin, also making multiple-copies unique...
m=Sketchup.active_model;s=m.selection.to_a;is=s.find_all{|i|i.class==Sketchup;;ComponentInstance};m.start_operation('t');is.each{|i|i.make_unique if i.definition.instances[1];d=i.definition;t=i.transformation;es=d.entities;es.transform_entities(t, es.to_a);i.transform!(t.inverse)};m.commit_operation
-
Prefect, this is exactly what I meant (and nested components are not affected, exactly as I wished).
Thank you very much, TIG!
(Note to myself and others: the plugin uses the original world axes so if one moves the axes elsewhere, do not be surprised)
I'd have a question though. Now I have a bunch of lines of code: what do I need to do to have a plugin from those?
And thanks Tim as well of course - but I did not go to try after this
-
That's ok, Csaba. If I were TIG, I would have done the same thing as he.
EDIT: only, it would have taken me a week to get back to you. -
Funny, just today I was needing the same thing.
Thanks! -
Thanks very much again, TIG!!!
-
Hi Gaï, TIG, tim, Jan,
Can someone shows in what sort of case this new plugin is (very) useful? Excuse me but my mind is dry to imagine it
simon
PS: However, thank you TIG for this one and how many others+++
-
Hi, simon:
What I understand is this plugin will place the axes/origin of numerous components at the global axes origin of the model space. Gaieus can explain his purpose better than me. I was just cruising the Plugins Index in response to his request. -
As long as components haven't been purged from model, it would make it very easy to replace stuff that has been deleted from the working model - sort of paste in place for things not on the clipboard.
-
It's great plugin!
But unfortunately it do not work for proper crop orientation of "make unique texture" function(
-
There is a way to make it work on any components and groups in the model not only the top level ones?
-
I would like it to work for all nested components within a component. So if we use the co nand on one component, all the nested components should also get originated axes. Currently it works for a single component. We have to manually select the nested components every tome within a component to make this plugin work.
-
In addition to making this work on groups as well as the components, It should have option to work on all nested groups and components?
Also, perhaps way to choose which axis to change to. Not limited to the world only, but perhaps to the axis of the currently active component or group?
I hope this makes sense.
-
Is there a similar plugin to force align ALL selected component/groups AND nested subgroups/subcomponents local Y+ axes to world Z+?
That would be extremely handy when preparing models for game engines and similar stuff..
I'm searching everywhere with no luck..
Advertisement