How to align all components axis to world axis
-
Hi Folks, I need some help here, I have a model of a roof framing. The roof framing consists of components generated from a plugin by Vali Architects called instant roof. I need to create a detail of each component of the framing in layout, so... I have been searching for a workflow and or plugin to help me achieve this. In order to make this work; currently I manually set each components position and rotation attributes to =0...then I change the component axis (which is currently sitting at the world axis) to align with the framing member.
This in essence realigns the component's axis to the world axis ( made straight ) i.e" set the component axis to 0,0,0 and rotx, roty, and rotz all to 0.
From there I can see some potential for using other plugins like Parts --> scenes. However, right now the skew/rotation of components is messing me up.
Any ideas?
Is there a plugin or an easier method of resetting all components to 0,0,0 and rotx, roty, and rotz all to 0. And preferably resetting the component axis to the components 0,0,0?
A point of particular interest...The components I am re positioning have child components and I do not want those reoriented so even if I have to select each component and then initiate a script I would be much further ahead.
-
I know Thomthom has an Axis plugin but it doesn't place them at world 0,0,0.
-
Hi Rich,
I tried to work his axes tool into my work flow but the position of the axes is moved to the bounding box of the component. I still must move the axis onto the component and re-position and un-rotate...(is that a word?)
Thanks for chiming in though...Rich
-
@iaddic said:
Hi Rich,
I tried to work his axes tool into my work flow but the position of the axes is moved to the bounding box of the component. I still must move the axis onto the component and re-position and un-rotate...(is that a word?)
Thanks for chiming in though...Rich
How do you decide where "onto the component and re-position" is?
Some screenshots or a model of what you are doing would be most helpful.
-
Steps
1.) re position the component axes
2.) Open component dialog window
3.) select all position attributes and rotation attributes
4.) set each to 0in the model provided I have followed this procedure for components labeled Group617#1, Group619#4, and Group621#2. You will notice they are all now sitting at position 0,0,0 with a rotation of rotx = 0, roty = 0, and rotz = 0. I plan on using Parts --> Scenes plugin to place each component in a separate scene and then dimension them in Layout.
If look at Group619#4 it was sitting much like Group625#2 but on the opposite side of the model.
You will also notice that its current origin is 0,0,0 but the component position is offset to x=-65938.311102", y=-12780.035294", z=7.672292" and the bounding box is not rotated but the component itself is.
In order to get a true front, top, and side views for dimensioning the rotation and position of the components must be "straight" (i.e along one of the main axes'.
If you have any ideas on plugins or workflow I'd be most interested....I've tried Chris Fullmer tool "center on origin and this gets the component close to 0,0,0 but the rotation is still present...I've tried the plugin "Move to Origin" which unlike Chris' it moves the component to the origin but the weird thing is the component attributes still show offset values for x, y, and z (if someone can explain this it would be nice to know what is going on for real)...Then I tried TomTom's Axes tool and it moves to axis to the bounding box.
Then I tried QJS Align but it doesn't do anything...I think I understand what it is attempting to do but nothing in the model moves...I've also reviewed thing like the TIG Originate component axis but it does exactly opposite of what I am looking to do...it places all component axes at the world origin which is where I already am...
So, as you can see, I've tried a lot of things but have gone nowhere...except to continue manually doing the change...Unfortunately, the model I am showing here is a very simple model and I've got models with 100's of components...
Now, finally let me say I may be going about this all wrong. At the end of the day I simply need the parts oriented in a way that I can accurately dimension them...If you have a better way then I am all ears
-
an image before / after wished
will maybe more explicite -
Hi Frenchy Pilou: Here is the sequence in images...
The initial Model:
Select the component wanting to be moved...AND change the axes position...eventually all components need to be relocated.
Open the component dialog and expose all position and rotation attributes:
Set all values to zero:
Note the final position of the selected component at location 0,0,0 and rotx=0. roty=0, and rotz=0 - Repeat this for all components in the model...this is a small model, some of my models can have 100's of components.
Hope this helps and leads to a solution...thanks much, Rich
-
You may be confusing origin and insertion point. The insertion point is usually 0,0,0 while the origin is where ever the component is in "the world".
Perhaps just creating a special layer and placing an un-rotated copy of each on it for dimension purposes.
-
sdmitch. The problem is the component is generated from an app so the origin of the component is as described...I've made a local library of the components and tried placing them again but they are all rotated per their original placement. If I placed each component from the library I'd end up with the same model as the original...unless you know of a way to reset the origin I think I am still stuck.
-
@iaddic said:
sdmitch. The problem is the component is generated from an app so the origin of the component is as described...I've made a local library of the components and tried placing them again but they are all rotated per their original placement. If I placed each component from the library I'd end up with the same model as the original...unless you know of a way to reset the origin I think I am still stuck.
Yes it is obvious that the components were not created on the xy plane and aligned with a single axis. So far all I have been able to do is reset the transformation so that it is at the .bounds.min and not somewhere in never never land.
I'll work on this problem some more tomorrow to see if I can't get them on the xy plane.
-
sdmitch, I have discovered you are quite the sketchup aficionado and I appreciate your experience and help on this. I have tried so much but just started using sketchup this year....so I figured I just didn't understand something but after nothing seemed to work I am thankful you are helping. I hope to hear good news. rich
-
@iaddic said:
sdmitch, I have discovered you are quite the sketchup aficionado and I appreciate your experience and help on this. I have tried so much but just started using sketchup this year....so I figured I just didn't understand something but after nothing seemed to work I am thankful you are helping. I hope to hear good news. rich
Rich, flattery will get you no where.
I have attached your file with the component origins reset just to see if we are headed in the right direction while I'm thinking about the next problem.
-
sdmitch:
I see you have moved the origin to the objects' bounding box. I am not certain I see your next move though. Now the component can be moved to 0,0,0 easy enough but the component editor does not know the object is skewed within the bounding box. I have always positioning the axes on the object so that it can be rotated...understanding of course you know more about this than I do.
Oh, as for flattery...just calling it how I've come to see it! I visited your blog and see you have a treasure chest of tools...You don't build that kind of arsenal without knowing something!
Rich
-
How about this oldie? : http://sketchucation.com/pluginstore?pln=TIG_originatecomponnetsaxes
-
@iaddic said:
sdmitch:
I see you have moved the origin to the objects' bounding box. I am not certain I see your next move though. Now the component can be moved to 0,0,0 easy enough but the component editor does not know the object is skewed within the bounding box. I have always positioning the axes on the object so that it can be rotated...understanding of course you know more about this than I do.
Oh, as for flattery...just calling it how I've come to see it! I visited your blog and see you have a treasure chest of tools...You don't build that kind of arsenal without knowing something!
Rich
The next step is to try to remove the "skew". Don't assume I know anything because I probably don't when it comes to this problem.
-
A new version of the model to checkout. All components "deskewed" except the diagonal ones,Group623#3 and Group625#2, which apparently have to be treated differently for some reason.
Let me know if this solves some of the problem.
-
sdmitch: Yes it does appear all the skew is removed except for the diagonal pieces. Since you've been able to move the component axes and eliminate the skew from most all the components, it is easy enough to rotate the diagonal pieces using the protractor. If this is all that needs to be addressed then we have moved monumentally in the right direction.
Tig: I tried your originate axes script and it is exactly opposite of what I think I need. It moved all the components axes to the origin and then I was still left with the skew.
sdmitch: My only concern is the comment you made indicating you were uncertain why the ones that did not skew didn't. How is this siting with you at the moment? Do you have an understanding? Should we let that dog lie and move forward or do we need to understand that piece as well? As I mentioed, if all I must do is rotate a few components then that is minor compared to the many 100's of steps I would be performing.
What are the next steps then?
With warm regards,
Rich
-
TIG: Let me add...I am not trying to move the component axes to the world axes but align it in such a way that the components that are skewed become de-skewed (unskewed) ...are those words? Anyhow, thank you for looking into the situation...when I tested your script, all the axes moved to the origin...did I interpret that corectly or is there more there then that. Thanks, Rich
-
@iaddic said:
sdmitch: My only concern is the comment you made indicating you were uncertain why the ones that did not skew didn't.
The problem with the diagonal components is they are a component with another component inside and I wasn't expecting that so my logic failed. I will have to think about that some more.
I will send you, by personal message, a copy of the plugin as it currently exist as soon as I get the pieces put together and tested.
-
If you want all group/component axes parallel to one of its edges, can I I suggest the following...
Make an array of all group/component definitions and an initially empty array of processed definitions.
Look inside each group/component to getedges=definition.entities.grep(Sketchup::Edge)
,if ! edges[0]
then find any nested group/component instances, if it's in the processed set get theinstance.transformation.xaxis
and use that ?
But if it is not processed, then process that and then continue using thatinstance.transformation.xaxis
If it contains edges then filter those to get the edge that has its vectoredge.line[1] || edge.line[1].reverse
nearest the X_AXIS, and also the 'flattest' edge ? ... then use that vector...
The code in my script can be applied to transform each definition instance to its new insertion-point and transform its internal entities so they are realigned to suit that, and thereby appear unchanged.
Multiple instances either require multiple processes or make_unique ?
Advertisement