SketchUcation Plugin Store

 

 

[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
Please, register (free) to access all the attachments on the forums.
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
 
Posts: 6695
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] Center on Origin

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

ooh I wanted this as well :)

Thanks!
Khai
 
Posts: 548
Joined: Sun Mar 15, 2009 4:53 pm
Location: Onboard his TARDIS
Name: 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 ;)
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10067
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Center on Origin

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

very nice little toy, thanks for the contribution...
lucifer1101
 
Posts: 142
Joined: Tue Apr 28, 2009 1:43 pm
Name: jason

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:
"If you don't plan ahead you'll be at the mercy of those that do" - Ashleigh Brilliant

"Bad is not good until worse happens" - Bob James
User avatar
Bob James
Premium Member
Premium Member
 
Posts: 608
Joined: Fri Jan 18, 2008 9:29 pm
Location: Lompoc, CA, USA
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

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
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6695
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

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
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6695
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

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
La Connaissance n'a de valeur que partagée
MALAISE
 
Posts: 620
Joined: Sun Apr 20, 2008 1:23 pm
Location: Cergy Pontoise FRANCE
Name: Pierre

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!
raduteo
 
Posts: 91
Joined: Wed Jan 14, 2009 2:44 pm
Location: Constanta, Romania
Name: Radu

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?
User avatar
bagatelo
 
Posts: 243
Joined: Wed Apr 16, 2008 4:55 pm
Location: São José, Santa Catarina, Brasil
Name: Alex Henrique
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: interior design
Level of SketchUp: Intermediate

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:
TIG
User avatar
TIG
Global Moderator
 
Posts: 13997
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
User avatar
bagatelo
 
Posts: 243
Joined: Wed Apr 16, 2008 4:55 pm
Location: São José, Santa Catarina, Brasil
Name: Alex Henrique
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: interior design
Level of SketchUp: Intermediate

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......
TIG
User avatar
TIG
Global Moderator
 
Posts: 13997
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

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.
rootbender
 
Posts: 4
Joined: Fri Nov 20, 2009 4:46 pm

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.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

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 :)
eph
 
Posts: 2
Joined: Mon Feb 18, 2008 9:39 am

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 :)
haimat
 
Posts: 3
Joined: Sun May 12, 2013 10:14 pm
Name: Matthias
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: game and/or sci-fi modelling
Level of SketchUp: Beginner

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Need Authorised SketchUp Training by experts in various disciplines? Check out our Training details.

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: AlexB, ely has, fdrs, Google Adsense Bot, Oxer, PatrickVinther, wroberts@uwf.edu and 11 guests