PDA

View Full Version : How do I create this toolbar button/hotkey



Frank the Frowner
22nd Jun 2007, 03:52 am
I want a hotkey/toolbar to automaticly do "UCS>OB" for orienting the UCS to a line for polar tracking. How do i write that command out in one key stroke?

Cad64
22nd Jun 2007, 04:42 am
What version are you running?

You can use this macro and tie it to a toolbar button: ^C^C_ucs _ob

Or a simple lisp function like this that can be called from the keyboard:



(defun c:ob (/)
(command "ucs" "ob")
(princ)
)

SEANT
22nd Jun 2007, 09:15 am
As a cautionary note:

A new UCS generally needs 3 non-colinear point. A single line does not meet that requirement. While it is possible to set a UCS via a line object, the process uses info contained within the line that is not easily recognized. (see sample)

This could introduce a lot of erratic z values in a drawing.

Edit: Blue is correct, Red slightly skewed, Green z axis aligned to line

Frank the Frowner
22nd Jun 2007, 01:12 pm
Is there a way then to change the angle of the polar tracking on the fly? I know 'snapang' but that doesn't help in polar tracking. Any suggestions?

Cad64
22nd Jun 2007, 03:10 pm
Using the "Object" option of the UCS command will work perfectly fine for aligning your UCS for 2D work. I use this method all day, every day. But, what Seant said is true, so you just have to keep your eyes open and visually check the orientation after every adjustment to make sure the alignment is correct. If your UCS icon looks skewed or you see X and Z instead of X and Y, then you know there is something wrong with your linework. If you're working in 3D, then you should probably use one of the other options of the UCS command. The "Object" option does work in 3D, but you don't always get exactly what you want.

You mentioned Polar Tracking in your last post, which is a different subject. Are you trying to align your UCS to an object or are you trying to change your polar tracking settings? :unsure:

Also, please update your profile so we know what version of Cad you're using. This will help us to better help you. :)

Frank the Frowner
22nd Jun 2007, 04:20 pm
Thanks for the replies. I mainly do Civil work with no 3D modeing in ACAD 2006 at work and 2007 at home. I realized that 'snapang' is just fine as well with ortho turned on, that way it draws along the snap anlge.

So I think that either UCS>OB will work or 'snapang' will work for what I need it to do.

Thanks.

SEANT
22nd Jun 2007, 10:52 pm
Using the "Object" option of the UCS command will work perfectly fine for aligning your UCS for 2D work.

I agree with that.

KG6ABB
9th Feb 2008, 10:51 pm
Okay...this might seem odd but type UCS
it says that it is in world but simply start the first click as if you had used UCS>OB. The world UCS remains at the original 0,0,0