Announcements

We are currently experiencing an issue impacting some Autodesk Products and Services - please refer to the Autodesk Health Dashboard for updates.

Find Rotation Angle of the current View

Find Rotation Angle of the current View

arcticad
Advisor Advisor
4,293 Views
12 Replies
Message 1 of 13

Find Rotation Angle of the current View

arcticad
Advisor
Advisor

I'm looking to find the current rotation of my view in modelspace.

This isn't the ucs directionm but any arbitrary view i'm using.

For example using 3dorbit to rotate around an object.

I want to match some temp graphics to align flat to my view.

 

EDIT:

I see there is a VIEWDIR variable. so that may be what I need

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
4,294 Views
12 Replies
Replies (12)
Message 2 of 13

Hallex
Advisor
Advisor

Just a shot in the dark

GetSystemVariable("ucsxdir") maybe

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 3 of 13

arcticad
Advisor
Advisor

ucsxdir gives me the angle of the ucs and not the angle of the view as I am currently looking at it.

 

Thank You for the effort. It's appreciated.

---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 4 of 13

kerry_w_brown
Advisor
Advisor
public Vector3d get_ViewDirection();
 
Declaring Type: Autodesk.AutoCAD.DatabaseServices.Viewport 
Assembly: Acdbmgd, Version=18.2.0.0 

 


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
Message 5 of 13

arcticad
Advisor
Advisor

Can you give a code sample on how to access it. I'm not finding any examples.

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 6 of 13

kerry_w_brown
Advisor
Advisor

 

This may have some info

 

http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html?url=WS1a919382...


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes
Message 7 of 13

arcticad
Advisor
Advisor

I found the answer here

http://usa.autodesk.com/adsk/servlet/index?id=18162650&siteID=123112

in lesson 8

---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 8 of 13

dnicholsonZCTRT
Participant
Participant

Can you share a better link? I can't find a lesson 8.

 

Thanks.

0 Likes
Message 9 of 13

Alexander.Rivilis
Mentor
Mentor

@dnicholsonZCTRT wrote:

Can you share a better link? I can't find a lesson 8.

 

Thanks.


https://knowledge.autodesk.com/support/autocad/learn-explore/caas/simplecontent/content/lesson-8-bon...

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 10 of 13

at_mckinney
Explorer
Explorer

nobody here actually answered the question. They left little links for you to go and get it yourself, little frustrating.

Type "snapang" + enter and it'll display the current 2D view rotation. I can only answer for 2D at the moment. 

0 Likes
Message 11 of 13

ActivistInvestor
Mentor
Mentor

@at_mckinney wrote:

nobody here actually answered the question. They left little links for you to go and get it yourself, little frustrating.


The only thing frustrating here is that the question was answered and that You probably aren't able to recognize it, because you don't realize that this is a programming-related discussion group.

 


Type "snapang" + enter and it'll display the current 2D view rotation. I can only answer for 2D at the moment. 

This is not an answer. This question asked ~4 years ago was about how to find the rotation angle of the current view in program code, not by issuing commands.

Message 12 of 13

dnicholsonZCTRT
Participant
Participant

This has worked for me.

1. UCS; View

2. Draw a random horizontal line in ortho mode.

3. UCS; World

4. List line rotation or set new UCS to line and save UCS (UCS; Save)

 

 

Message 13 of 13

ActivistInvestor
Mentor
Mentor

This discussion group is focused on programming.

 

The question was asked in the context of how to find out the rotation angle of the view in code, not interactively using commands,

 

However, the steps you outline for finding the answer interactively is the scenic route.

Command: VIEWTWIST
VIEWTWIST = 45 (read only)