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

    [Plugin] Center on Origin UPDATE May 23, 2013

    Scheduled Pinned Locked Moved Plugins
    35 Posts 18 Posters 43.3k Views 18 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      So having now got the idea - Edit the script and change the line
      vector = point.vector_to [0,0,0]
      to read
      vector = point.vector_to [point.x,point.y,0]
      It will then not change the X/Y values but will set the Z-value of the translation to zero......

      TIG

      1 Reply Last reply Reply Quote 0
      • R Offline
        rootbender
        last edited by

        Hello,

        The "Center on Origin" script only works correctly when the drawing axes are at (0,0,0).

        However, it is possible to move the drawing axes with Tool -> Axes to somewhere else
        that is not (0,0,0).

        How can center a selection to the currently set origin, which may not be at (0,0,0) ?

        Thanks.

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          Unfortunately, there is no access to the Origin of the moved Axes from Ruby.

          Hi

          1 Reply Last reply Reply Quote 0
          • E Offline
            eph
            last edited by

            Very cool!
            I know this is old stuff already, but would it be complicated to move everything to center (eventually while keeping Z-height), including hidden geometry, section cuts and most of all the Camera views..?

            Would be very grateful 😄

            1 Reply Last reply Reply Quote 0
            • H Offline
              haimat
              last edited by

              Thanks for this great plugin, that's exactly what I was looking for 😄

              1 Reply Last reply Reply Quote 0
              • genma saotomeG Offline
                genma saotome
                last edited by

                @chris fullmer said:

                And here's another option. If you want it to reset the component rotation and scale, edit the ruby file in a plain text editor (like notepad for example) and after the line:

                if comp.typename == "Group" || comp.typename == "ComponentInstance"

                add the two following lines:

                t = Geom::Transformation.new comp.transformation = t

                Chris

                I'm having some difficulty using this plug in on nested components that were created with a copy/paste/scale = -1. I was hoping to try a few of the edits cited in this thread but the ruby is a .rbz; My editor tells me its been locked up and uneditable... is there another way to get to the source?

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  The .rbz is just a zip file. Rename it to .zip and then unzip it. Inside there are regular .rb files that you can edit for your own personal use.

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • charly2008C Offline
                    charly2008
                    last edited by

                    Hi Chris,

                    I installed the new update but now get an error message.

                    Charly


                    2.jpg

                    He who makes no mistakes, makes nothing

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      Oh that's not good 😞

                      I'll have to work on testing this one tomorrow. I'm not sure what has gone wrong, but I'm pretty sure it'll be easy enough to find. Thanks Charly,

                      Chris

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • charly2008C Offline
                        charly2008
                        last edited by

                        No reason, I have to thank you. Another note, in Sketchup 2013 it works fine.

                        He who makes no mistakes, makes nothing

                        1 Reply Last reply Reply Quote 0
                        • Chris FullmerC Offline
                          Chris Fullmer
                          last edited by

                          Do you have any of my other scripts installed in 2013?

                          Also make sure that you deleted the old version that is in SU 8.

                          Chris

                          Lately you've been tan, suspicious for the winter.
                          All my Plugins I've written

                          1 Reply Last reply Reply Quote 0
                          • charly2008C Offline
                            charly2008
                            last edited by

                            I have to correct myself, even in "Sketchup 2013," an error message appears.

                            Yes I have more plugins from you, see picture below.


                            2.jpg


                            2013-05-26_223430.jpg


                            2013-05-26_225628.jpg

                            He who makes no mistakes, makes nothing

                            1 Reply Last reply Reply Quote 0
                            • Chris FullmerC Offline
                              Chris Fullmer
                              last edited by

                              Hey Charly, the screen shots are useful, but it does not show clf_center_on_orogin.rb listed in the lower screenshot, which I would expect, since you have the folder loaded, and the errors seems to be pertaining to center on origin.

                              I wonder if you have plugins lost in the Compatibility folders sonwhere. In the plugins folder, at the top do you see "Compatibility Folders" anywhere? See the first screenshot in the following:

                              Link Preview Image
                              Vista's "Show Compatibility Files" and the Scrumptious Wonder that is File Virtualization

                              I was trying to convert some (totally legal) video files into MP4 format for ...

                              favicon

                              (www.hanselman.com)

                              If you have that, click on it, select everything there and MOVE it back into the actual plugins folder.

                              Then try to restart SU, if you still have issues, take screenshots again and let me see what you have.

                              Or if you don't have any compatibility folders, could you send me your copy of center on origin? Thanks,

                              Chris

                              Lately you've been tan, suspicious for the winter.
                              All my Plugins I've written

                              1 Reply Last reply Reply Quote 0
                              • charly2008C Offline
                                charly2008
                                last edited by

                                I have all the clf_plugins piece by piece deactivated and found out that the "clf_arc_centerpoint_finder.rb" caused the error. After reinstalling everything works perfectly again. Sorry.

                                Charly

                                He who makes no mistakes, makes nothing

                                1 Reply Last reply Reply Quote 0
                                • Chris FullmerC Offline
                                  Chris Fullmer
                                  last edited by

                                  Oh good, glad you got it working. That makes sense to me. I had accidentally released a bugged version of arc_centerpoint_finder that was live for a few days. Looks like you got a copy of that one - sorry!

                                  Lately you've been tan, suspicious for the winter.
                                  All my Plugins I've written

                                  1 Reply Last reply Reply Quote 0
                                  • charly2008C Offline
                                    charly2008
                                    last edited by

                                    Dear Chris,

                                    I have now found that you are represented in the "Plugins menu" three times. Is that intentional from you?


                                    3.jpg


                                    2.jpg


                                    1.jpg

                                    He who makes no mistakes, makes nothing

                                    1 Reply Last reply Reply Quote 0
                                    • Chris FullmerC Offline
                                      Chris Fullmer
                                      last edited by

                                      Hi Charly, that is an unfortunate side-effect of my efforts to clean up my scripts. In your case, from what I can see, anything in the first and third menus are old scripts and should be updated. Unfortunately the updated versions are not yet published anywhere.....so for now you're stuck with the extra menu items - sorry about that! I'll let you know when I get all my updated scripts published. Thanks!

                                      Chris

                                      Lately you've been tan, suspicious for the winter.
                                      All my Plugins I've written

                                      1 Reply Last reply Reply Quote 0
                                      • N Offline
                                        nesh70
                                        last edited by

                                        Hi!

                                        Thanks for creating so useful SU plugin!

                                        BTW, is there a way to center a model or component like the image B (not like the original script do - image A)?

                                        Best regards!


                                        Original plugin behavior.


                                        My intention.

                                        1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          nesh70
                                          last edited by

                                          @nesh70 said:

                                          Hi!

                                          Thanks for creating so useful SU plugin!

                                          BTW, is there a way to center a model or component like the image B (not like the original script do - image A)?

                                          Best regards!

                                          I found out how to achieve it, changing the line

                                          vector = point.vector_to [0,0,0]

                                          to

                                          vector = point.vector_to [0,0,model.bounds.height / 2]

                                          😄

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

                                            Why not use something like
                                            vector = point.vector_to(model.bounds.center)
                                            for the center, or
                                            pt=model.bounds.center pt.z=model.bounds.min.z vector = point.vector_to(pt)
                                            for the center-bottom

                                            TIG

                                            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