[Plugin] Center on Origin UPDATE May 23, 2013

[Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Wed Apr 29, 2009 6:58 pm

Center on Origin
Description: Center a group or component on the model origin.
Usage: Activate this tool from Plugins>Chris Fullmer Tools>Center on Origin. It only works with groups and components, and you can only center one at a time. It does not rotate or change the scale of the object.
History
1.0 - 2009-04-29
  • First release
1.1.0 2013-23-2013
  • Extension Class Compatibility

This is a request from this thread. Todd at smustard.com also has a very similar script that moves geometry to the origin, but it works slightly different. It does not center it on the origin. This one works the way it does because it was a special request.

(no audio on this video. 14 seconds long)


Chris
1450
0
Last edited by Chris Fullmer on Thu May 23, 2013 10:53 pm, edited 1 time in total.
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin

Postby Khai » Wed Apr 29, 2009 7:25 pm

ooh I wanted this as well :)

Thanks!
0

Khai 
 

Re: [Plugin] Center on Origin

Postby pilou » Thu Apr 30, 2009 12:10 am

It was a while that you have not create a new plug ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Center on Origin

Postby lucifer1101 » Thu Apr 30, 2009 12:53 am

very nice little toy, thanks for the contribution...
0

lucifer1101 
 

Re: [Plugin] Center on Origin

Postby Bob James » Thu Apr 30, 2009 1:09 am

Very useful, Chris, thanks for taking the time to create it. :thumb:
0
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

Re: [Plugin] Center on Origin

Postby Chris Fullmer » Thu Apr 30, 2009 1:31 am

Pilou wrote:It was a while that you have not create a new plug ;)


I have literally been forcing myself to not write any, after the earlier innundation of scripts. I do have some ideas, and even one really cool one started, but I told myself I can't do more until I graduate (in like 2 or 3 weeks now!). Yeah, I need to focus on school for a little bit. Then I'll get back up and running on rubies again probably :)

Thanks for positive feedback.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin

Postby Chris Fullmer » Thu Apr 30, 2009 2:35 am

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
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin

Postby MALAISE » Thu Apr 30, 2009 8:44 am

Pilou wrote:It was a while that you have not create a new plug ;)


Strangely , I taught similar :roflmao:

Thanks Chris

MALAISE
0
La Connaissance n'a de valeur que partagée
User avatar
MALAISE 
 

Re: [Plugin] Center on Origin

Postby raduteo » Thu Apr 30, 2009 2:58 pm

And this is why SU is the best, works fabulously, thank you!
0

raduteo 
 

Re: [Plugin] Center on Origin

Postby bagatelo » Tue Feb 09, 2010 4:58 pm

Is there possible to make change on this script to only move to origin axes X and Y, not Z?
0
While the cat's away, the mice will play
User avatar
bagatelo 
 

Re: [Plugin] Center on Origin

Postby TIG » Tue Feb 09, 2010 5:05 pm

Edit the script and change the line
vector = point.vector_to [0,0,0]
to read
vector = point.vector_to [0,0,point.z]
It will then not change the Z -value of the translation... :geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Center on Origin

Postby bagatelo » Tue Feb 09, 2010 6:21 pm

Thanks, it works well. But if I want to move base of object to zero on Z axes? Thanks anyway.
0
While the cat's away, the mice will play
User avatar
bagatelo 
 

Re: [Plugin] Center on Origin

Postby TIG » Wed Feb 10, 2010 12:01 am

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......
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Center on Origin

Postby rootbender » Mon May 30, 2011 6:02 am

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

rootbender 
 

Re: [Plugin] Center on Origin

Postby Jim » Mon May 30, 2011 11:58 am

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

Jim 
Global Moderator
 

Re: [Plugin] Center on Origin

Postby eph » Wed Aug 31, 2011 9:39 am

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 :)
0

eph 
 

Re: [Plugin] Center on Origin

Postby haimat » Sun May 12, 2013 11:17 pm

Thanks for this great plugin, that's exactly what I was looking for :)
0

haimat 
 

Re: [Plugin] Center on Origin

Postby genma saotome » Sun May 26, 2013 5:16 am

Chris Fullmer wrote: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?
0
User avatar
genma saotome 
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Sun May 26, 2013 5:18 am

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.
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby charly2008 » Sun May 26, 2013 3:52 pm

Hi Chris,

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

Charly
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Sun May 26, 2013 5:37 pm

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
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby charly2008 » Sun May 26, 2013 6:07 pm

No reason, I have to thank you. Another note, in Sketchup 2013 it works fine.
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Sun May 26, 2013 8:18 pm

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
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby charly2008 » Sun May 26, 2013 9:36 pm

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

Yes I have more plugins from you, see picture below.
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Sun May 26, 2013 11:15 pm

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:

http://www.hanselman.com/blog/VistasSho ... ation.aspx

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
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby charly2008 » Mon May 27, 2013 12:16 am

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
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Mon May 27, 2013 3:23 am

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!
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby charly2008 » Mon May 27, 2013 1:14 pm

Dear Chris,

I have now found that you are represented in the "Plugins menu" three times. Is that intentional from you?
0
He who makes no mistakes, makes nothing
User avatar
charly2008 
 

Re: [Plugin] Center on Origin UPDATE May 23, 2013

Postby Chris Fullmer » Mon May 27, 2013 7:13 pm

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
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Center on Origin

Postby nesh70 » Fri Nov 01, 2013 2:01 am

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!
0

nesh70 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: 4ndrius , linkph, sreten and 8 guests

Visit our sponsors: