When running 3Do command to rotate the view, how to ensure that the text is always parallel to the screen?

When running 3Do command to rotate the view, how to ensure that the text is always parallel to the screen?

yangguoshe
Advocate Advocate
428 Views
5 Replies
Message 1 of 6

When running 3Do command to rotate the view, how to ensure that the text is always parallel to the screen?

yangguoshe
Advocate
Advocate

When running 3Do command to rotate the view, how to ensure that the text is always parallel to the screen? When the view is rotated, the text remains at the angle shown in Figure 2 ,  thank you!GIF2222.gif

QQ截图20211219203736.png

     

0 Likes
429 Views
5 Replies
Replies (5)
Message 2 of 6

Sea-Haven
Mentor
Mentor

It is possible did something similar using UCSDIR value that is are far as I can go right now.

0 Likes
Message 3 of 6

yangguoshe
Advocate
Advocate

Thank you for your reply! Static conversion can be realized. I want to know how to realize dynamic conversion, that is, when running 3Do command, the text will automatically rotate and align the screen. For example, how to realize it with reactor? thank you!

0 Likes
Message 4 of 6

Sea-Haven
Mentor
Mentor

Have you thought about using a layout ?

0 Likes
Message 5 of 6

yangguoshe
Advocate
Advocate

Thank you for your reply! It is not considered to be implemented in the layout . For example, I want to label the point coordinates of 3D objects. When the view is rotated, the label text of the point coordinates is still aligned with the screen

0 Likes
Message 6 of 6

yangguoshe
Advocate
Advocate

Can the following code(from this forum) be adapted to achieve that effect?  Thank you!  website:

 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-window-reactor-need-example...

 

(vlr-remove-all)
(setq svr (vlr-sysvar-reactor
(list (cons "VIEWCTR" (getvar "viewctr"))
(cons "VIEWSIZE" (getvar "viewsize"))
)
'((:vlr-sysvarchanged . svcbexample)

)
)
)
(defun svcbexample (r l / data ovc ovs nvc nvs)
(setq data (vlr-data r))
(setq ovc (cdr (assoc "VIEWCTR" data))
ovs (cdr (assoc "VIEWSIZE" data))
nvc (getvar "viewctr")
nvs (getvar "viewsize")
)
(if (not(equal ovc nvc))
(progn
(alert (strcat "\nViewctr has changed. It was: "
(vl-princ-to-string ovc)
" It is now: "
(vl-princ-to-string nvc)
)
)
(setq
data (subst (cons "VIEWCTR" nvc) (assoc "VIEWCTR" data) data)
)
)
)
(if (not(equal ovs nvs))
(progn
(alert (strcat "\Viewsize has changed. It was "
(rtos ovs)
". It is now "
(rtos nvs)
)
)
(setq data
(subst (cons "VIEWSIZE" nvs ) (assoc "VIEWSIZE" data) data)
)
)
)
(vlr-data-set r data)
)

0 Likes