andy_lee Posted September 1, 2015 Share Posted September 1, 2015 Hello Is any way to get view name in current drawing ? top ,bottom,left,reght ,front , etc. This code is change the object form left view to top view. I want auto judge the current view name , and change the object to top view. Thanks a lot . (defun c:test(/ ss) (if(setq ss(ssget)) (progn (setvar 'cmdecho 0) (command "_.rotate3d" ss "" "z" "non" "0,0,0" "90") (command "_.rotate3d" ss "" "x" "non" "0,0,0" "-90") (sssetfirst nil ss) (setvar 'cmdecho 1) ) ) ) Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted September 1, 2015 Share Posted September 1, 2015 I don't believe that when a view is changed to left or right or bottom views etc... that it is stored as a named view as if you were to use the view command and save a named view. One way that I can think of knowing whether it is top or left or what not, is to look at the VIEWDIR system variable. For example: if (setq vdir (getvar "VIEWDIR")) returns ( 0 , 0 , 1.0) then you are looking at the top view. (0, 0, -1.0) = bottom if it returns (0 , negativenumber , 0) you are looking at front if it returns (0, positivenumber, 0) you are looking at the back I hope this helps you in some sort of way. regards, Ben Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 2, 2015 Author Share Posted September 2, 2015 Hello, Hippe I use (getvar "VIEWDIR") at top , left ,right ,front view , all returns (0.0 0.0 1.0) Quote Link to comment Share on other sites More sharing options...
hmsilva Posted September 2, 2015 Share Posted September 2, 2015 Hi andy_lee, you'll have to test the viewdir, ucsxdir and ucsydir System Variables... Hope this helps, Henrique Quote Link to comment Share on other sites More sharing options...
eldon Posted September 2, 2015 Share Posted September 2, 2015 Perhaps you could use the command VPOINT. This from my Help files Define a 3D View with Coordinate Values or Angles To set standard views with VPOINT (AEC convention) On the command line, enter vpoint. Enter a coordinate according to the viewpoint you want: Enter 0,0,1 for a top (plan) view. Enter 0,-1,0 for a front view. Enter 1,0,0 for a right side view. Enter -1,0,0 for a left side view. Enter 1,-1,1 for an isometric view. Command line VPOINT Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 2, 2015 Author Share Posted September 2, 2015 Hi andy_lee,you'll have to test the viewdir, ucsxdir and ucsydir System Variables... Hope this helps, Henrique Dear Henrique Thank you very much! emk2012 is me . Quote Link to comment Share on other sites More sharing options...
hmsilva Posted September 2, 2015 Share Posted September 2, 2015 Dear HenriqueThank you very much! emk2012 is me . You're welcome, andy_lee Glad I could help! And, I know emk2012 is you... Henrique Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 2, 2015 Author Share Posted September 2, 2015 You're welcome, andy_leeGlad I could help! And, I know emk2012 is you... Henrique Dear Henrique You help me many times !All Very Much Appreciated! 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.