MJLM Posted May 23, 2020 Share Posted May 23, 2020 I need what the title basically says. I want to set for example the SW view of my model when in a UCS through lisp. Having looked in the -view command I cant find something relevant, only the orthographic ones. Is there a way to set a system variable through a vector, say '(-1 , -1 , 1) ? In suggestions appreciated. Quote Link to comment Share on other sites More sharing options...
lrm Posted May 23, 2020 Share Posted May 23, 2020 Are you asking how to create an isometric view relative to the current UCS in LISP? In addition, do you want the option to choose one of the 8 possible views? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted May 23, 2020 Share Posted May 23, 2020 3 hours ago, MJLM said: I need what the title basically says. I want to set for example the SW view of my model when in a UCS through lisp. Having looked in the -view command I cant find something relevant, only the orthographic ones. Is there a way to set a system variable through a vector, say '(-1 , -1 , 1) ? In suggestions appreciated. do you mean command -vpoint -1,-1,1 ? (getvar 'viewdir) ;R.O Quote Link to comment Share on other sites More sharing options...
MJLM Posted May 24, 2020 Author Share Posted May 24, 2020 I figured out I was using vla methods for that, that is... (setq vw (vla-get-activeviewport (setq *acdoc* (vla-get-activedocument (vlax-get-acad-object))))) (vlax-put vw 'direction '(-1.0 -1.0 1.0)) (vla-put-activeviewport *acdoc* vw) I was using the WCS and all worked fine. Now in an arbitrary UCS where the xy plane is not coplanar with the WCS xy it does not. I m guessing the vector has to be expressed in WCS coordinates. I am using instead (vlax-put vw 'direction (trans '(-1.0 -1.0 1.0) (trans '(0.0 0.0 1.0) 1 0 t) 0 t)) as my desired viewing direction is SW. But the result is not as expected. Any ideas? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted May 24, 2020 Share Posted May 24, 2020 2 hours ago, MJLM said: as my desired viewing direction is SW. But the result is not as expected. Any ideas? try (vlax-put vw 'direction (trans '(-1.0 -1.0 1.0) 1 0 t) ) if ucs '(-1 1 1) , swap x y (trans '(1 -1 1) 1 0 t) untested i maybe wrong Quote Link to comment Share on other sites More sharing options...
MJLM Posted May 24, 2020 Author Share Posted May 24, 2020 (edited) Thank you. I tested it as you suggested and it seems it is working but not totally. The axes come to the correct orientation but the model is coming upside down. In other words it needs 180 deg rotation around the perpendicular to the screen axis (considered crossing in the middle of the screen) to make it look good. Is it happening to me only? FYI, the UCS I have is rotated once per Z-WCS then per Y-WCS. Edited May 24, 2020 by MJLM Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.