sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    How to align all components axis to world axis

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    23 Posts 5 Posters 6.8k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I Offline
      IADDIC
      last edited by

      Hi Frenchy Pilou: Here is the sequence in images...

      The initial Model:

      http://iaddicshelters.net/Sketchup_Problem/Initial_Model_State.PNG

      Select the component wanting to be moved...AND change the axes position...eventually all components need to be relocated.

      http://iaddicshelters.net/Sketchup_Problem/Select_componet_and_change_axes.PNG

      Open the component dialog and expose all position and rotation attributes:

      http://iaddicshelters.net/Sketchup_Problem/Open_component_Dialog.PNG

      Set all values to zero:

      http://iaddicshelters.net/Sketchup_Problem/Cange_all_values_to_zero.PNG

      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.

      http://iaddicshelters.net/Sketchup_Problem/New_position.PNG

      Hope this helps and leads to a solution...thanks much, Rich

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        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.

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • I Offline
          IADDIC
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • sdmitchS Offline
            sdmitch
            last edited by

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

            Nothing is worthless, it can always be used as a bad example.

            http://sdmitch.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • I Offline
              IADDIC
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • sdmitchS Offline
                sdmitch
                last edited by

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


                SDM Model 00 Roof Flat Framing.skp

                Nothing is worthless, it can always be used as a bad example.

                http://sdmitch.blogspot.com/

                1 Reply Last reply Reply Quote 0
                • I Offline
                  IADDIC
                  last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • TIGT Offline
                    TIG Moderator
                    last edited by

                    How about this oldie? : http://sketchucation.com/pluginstore?pln=TIG_originatecomponnetsaxes

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • sdmitchS Offline
                      sdmitch
                      last edited by

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

                      Nothing is worthless, it can always be used as a bad example.

                      http://sdmitch.blogspot.com/

                      1 Reply Last reply Reply Quote 0
                      • sdmitchS Offline
                        sdmitch
                        last edited by

                        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.


                        SDM Model 00 Roof Flat Framing.skp

                        Nothing is worthless, it can always be used as a bad example.

                        http://sdmitch.blogspot.com/

                        1 Reply Last reply Reply Quote 0
                        • I Offline
                          IADDIC
                          last edited by

                          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

                          1 Reply Last reply Reply Quote 0
                          • I Offline
                            IADDIC
                            last edited by

                            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

                            1 Reply Last reply Reply Quote 0
                            • sdmitchS Offline
                              sdmitch
                              last edited by

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

                              Nothing is worthless, it can always be used as a bad example.

                              http://sdmitch.blogspot.com/

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by

                                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 get edges=definition.entities.grep(Sketchup::Edge), if ! edges[0] then find any nested group/component instances, if it's in the processed set get the instance.transformation.xaxis and use that ?
                                But if it is not processed, then process that and then continue using that instance.transformation.xaxis
                                If it contains edges then filter those to get the edge that has its vector edge.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 ?

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • I Offline
                                  IADDIC
                                  last edited by

                                  sdmitch: I hope you understand what TIG is suggesting. For me, it is becoming more and more obvious I will need to learn Ruby...So far I've 6 months getting into the depths of Sketchup and Layout...It is becoming obvious that those who fair the best (in getting the application to do what they need) know Ruby.

                                  1 Reply Last reply Reply Quote 0
                                  • TIGT Offline
                                    TIG Moderator
                                    last edited by

                                    The native context-menu item 'Change Axes' lets you reset the axes of a selected Component - e.g. so they then align with a skewed beam's sides etc.
                                    This doesn't work on Groups, but you could first use the context-menu 'Make Component' on the Group before resetting its axes...
                                    To revert it back into a Group think about making it into a component, then sorting out that component's axes, then editing its contents, selecting-all and 'Make Group'; finally you exit that edit and explode the component, the resultant no longer nested Group will retain reset axes matching the temporary component container...

                                    TIG

                                    1 Reply Last reply Reply Quote 0
                                    • I Offline
                                      IADDIC
                                      last edited by

                                      TIG: I have been doing something similar on a component by component basis. The problem is some of my models have 100's of these skewed objects (the example I show is small). Hence, sdmitch has been looking to help solve the problem in mass. The need for doing so is driven by that fact the skewed objects must be detailed in Layout and can not be done so accurately while they are skewed.

                                      So the thought was simple...the solution less so.

                                      1.) reset the axis
                                      2.) de-skew
                                      3.) use the Plugin Parts-->Scene
                                      4.) Detail in Layout

                                      Step 1 and 2 were taking forever doing them manually so I asked for help in
                                      1.) Asking if I first understood my problem
                                      2.) Seeking alternative existing solutions
                                      3.) finding help in developing a solution for the problem in scale.

                                      Seems like sdmitch has a 95% solution. As you can see from his posts, most of the objects are de-skewed with the script he is working on except for nested ones. This is huge and if he solves the last piece it is monumental for me personally. If I had just a few items to contend with I would use the native menu driven solutions. That works fine...but when many model with many items are in this condition the problem is, well...difficult.

                                      1 Reply Last reply Reply Quote 0
                                      • 1
                                      • 2
                                      • 2 / 2
                                      • First post
                                        Last post
                                      Buy SketchPlus
                                      Buy SUbD
                                      Buy WrapR
                                      Buy eBook
                                      Buy Modelur
                                      Buy Vertex Tools
                                      Buy SketchCuisine
                                      Buy FormFonts

                                      Advertisement