Center to origin

Next
 From:  PaQ
2409.1 
Hi Michael,

Sorry if it has allready be asked, but is it possible to create a little scipt to center (move) a selected entity (surfaces, solids, curves) to the world origin ?
(not sure if the request is clear :))
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2409.2 In reply to 2409.1 
Hi PaQ, yup this is pretty easy to do now since a couple of betas ago I added some stuff so that scripts could access an object's bounding box.

Take the attached file CenterAtOrigin.js and copy it to your v2's \commands sub-folder.

Then set up a keyboard shortcut with CenterAtOrigin (note, no .js at the end, and no script: at the start, just that plain name) as the command part and that should do it.

Please let me know if it does not work for you.

- Michael


EDIT: Updated attachment to new version that centers object at the cplane origin if there is a custom cplane set, otherwise at world origin.

EDITED: 15 Feb 2009 by MICHAEL GIBSON

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  PaQ
2409.3 In reply to 2409.2 
Perfect Michael, thanks a lot !!!!!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Schbeurd
2409.4 
Extremely useful.

Thanks Michael (and thanks to PaQ for asking this... Hehe)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  PaQ
2409.5 In reply to 2409.4 
Hey happy it's handy for you Schbeurd :)

Hi Michael,

Just a other question, is it possible that the 'center at origin' works with the cplane too ? so the selection is center to the cplane origin when you're using a cplane, or to the world when cplane is off. I hate to fell like I'm at in a scipt-supermarket, but it's really not my cup of tea, so thanks for you help.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Colin
2409.6 In reply to 2409.2 
Hi Michael,

Thanks very much for making this & Thanks to PaQ for requesting it.

FWIW I'm using F4 as my keyboard shortcut so it'll match up for use when I'm using Rhino.

regards Colin
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2409.7 In reply to 2409.5 
Hi PaQ,

> Just a other question, is it possible that the 'center at origin'
> works with the cplane too ? so the selection is center to the
> cplane origin when you're using a cplane, or to the world
> when cplane is off.

Yup, it's only a tiny adjustment to make that work.

I've updated the attachment to that previous message
(http://moi3d.com/forum/index.php?webtag=MOI&msg=2409.2)
to work like that now, so just copy that new version over top of the previous one.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  PaQ
2409.8 In reply to 2409.7 
haaaaa really cool, thanks for taking a bit from your time to this script Michael !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All