Find rotation of viewcube/coordinate plane in AutoLISP

Find rotation of viewcube/coordinate plane in AutoLISP

davidlanesmith673
Enthusiast Enthusiast
536 Views
3 Replies
Message 1 of 4

Find rotation of viewcube/coordinate plane in AutoLISP

davidlanesmith673
Enthusiast
Enthusiast

On my AutoCAD drawing, the coordinate plane is rotated, and I was wondering if there is a way to find that rotation using AutoLISP.

davidlanesmith673_0-1623339326207.png

 

0 Likes
Accepted solutions (1)
537 Views
3 Replies
Replies (3)
Message 2 of 4

marko_ribar
Advisor
Advisor

(cvunit (angle '(0 0) (getvar 'ucsxdir)) "radian" "degree")

 

HTH. M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

I think the UCSXDIR System Variable would be applicable if it was the User Coordinate System that's rotated, but if that were the case, you would not see the little box at the axis intersection, which indicates that you're still in the World CS, and the appearance of the icon is from a twisted view, not a rotated UCS.  I think you want the VIEWTWIST System Variable, which will tell you the angle directly, using your current angular units mode and precision.

Kent Cooper, AIA
0 Likes
Message 4 of 4

davidlanesmith673
Enthusiast
Enthusiast

Finding the VIEWTWIST system variable worked. I tried the first suggestion, but it just returned 0.

Thanks @Kent1Cooper !

0 Likes