Correctly setting UCS Location and Angle through Lisp

Correctly setting UCS Location and Angle through Lisp

SORONW
Advocate Advocate
977 Views
4 Replies
Message 1 of 5

Correctly setting UCS Location and Angle through Lisp

SORONW
Advocate
Advocate

Hi All,

I'm trying to use the follow snipet of code, to set my UCS according to 2 points and it seems to have some inconsistencies that I haven't been able to iron out. It will sporadically not follow the Ortho and go in a seemingly random direction.

(defun c:test (/ Origin1 Origin2 )
(progn
		(setq 	Origin1 (getpoint "\n Origin of Part:")) 	;Prompt user for placement and angle of parts
		(setvar "orthomode" 1)
		(setq	Origin2 (getpoint Origin1 "\n Angle of Part:"))
		(command "_.UCS" Origin1 Origin2 "")
)
)

 Any guidance you can provide would be much appreciated.

0 Likes
978 Views
4 Replies
Replies (4)
Message 2 of 5

Jonathan3891
Advisor
Advisor

Are you aware that this is not necessary what so ever?

 

When you activate the "UCS" command the default option allows you to do exactly this. I mean if you really want a command to do this, then it would look like this;

 

(defun c:ttt ()
(command "ucs" pause pause "")
(setvar 'orthomode 1)
)

 


Jonathan Norton
Blog | Linkedin
0 Likes
Message 3 of 5

SORONW
Advocate
Advocate

I should have been a bit clearer, I'm using this as part of a larger routine to define a temporary ucs to draw several shapes. The rest of the routine works as intended, so I took this little section out to iron out some of the issues.

0 Likes
Message 4 of 5

Jonathan3891
Advisor
Advisor

Deleted


Jonathan Norton
Blog | Linkedin
0 Likes
Message 5 of 5

Kent1Cooper
Consultant
Consultant

This looks like a case for the classic question:  Do you sometimes have any running Object Snap mode(s)?  Does it ever have the problem when Osnap is off?

Kent Cooper, AIA
0 Likes