Rotate the active viewport using a tool palette macr

Rotate the active viewport using a tool palette macr

reuter.philipp
Enthusiast Enthusiast
754 Views
9 Replies
Message 1 of 10

Rotate the active viewport using a tool palette macr

reuter.philipp
Enthusiast
Enthusiast

I want to create a macro in the tool palette to rotate the active viewport by -90 degrees, but unfortunately it doesn't work like that and I don't get anywhere, where is the error or is there a better way to create the command for English and German as a macro? The main problem is the _R / Rotate subcommand in _MVSETUP;_A;_R:0,0,0;-90, because unfortunately it doesn't exist, as with the other parameters?

 

(setq v (vl-registry-read (strcat "HKEY_LOCAL_MACHINE"(chr 92)(vlax-product-key)) "Language"))(if (= v "Deutsch")(command "_MVSETUP" "_A" "D" "0,0,0" "-90" "")(command "_MVSETUP" "_A" "R" "0,0,0" "-90" ""))
_MVSETUP;_A;(setq v (vl-registry-read (strcat "HKEY_LOCAL_MACHINE"(chr 92)(vlax-product-key)) "Language"))(if (= v "Deutsch")(command "D")(command "R"));0,0,0;-90;

 

Greetings,

Philipp

0 Likes
Accepted solutions (1)
755 Views
9 Replies
Replies (9)
Message 2 of 10

johnyDFFXO
Advocate
Advocate

_MVSETUP;_A;_R:0,0,0;-90;;

 

... don't you have just a typo in it?

 

>>

_MVSETUP;_A;_R;0,0,0;-90;;;

0 Likes
Message 3 of 10

reuter.philipp
Enthusiast
Enthusiast

No, in the German Version i get those result with your sugestions:


Macro: _MVSETUP;_A;_R:0,0,0;-90;;

 

Befehl: _MVSETUP
Option eingeben [Ausrichten/Erstellen/ansichtsfenster Skalieren/Optionen/schrifTfeld/Zurück]: _A
Option eingeben [Winkel/Horizontal/Vertikal/ansicht Drehen/Zurück]: _R:0,0,0
Ungültiger Optionstitel.

 

 

Macro: _MVSETUP;_A;_R;0,0,0;-90;;;

 

Option eingeben [Ausrichten/Erstellen/ansichtsfenster Skalieren/Optionen/schrifTfeld/Zurück]: _A
Option eingeben [Winkel/Horizontal/Vertikal/ansicht Drehen/Zurück]: _R
Ungültiger Optionstitel.

 

 

Working German Macro: _MVSETUP;_A;_D;0,0,0;-90;;;

 

But I just saw that it sets the view to -90 instead of rotating it, what can I do?

Greetings,

Philipp

0 Likes
Message 4 of 10

johnyDFFXO
Advocate
Advocate

Try this macro? Does it do what you want?

 

_MSPACE;_UCS;_W;_DVIEW;;_TW;270;;_UCS;_P;_PSPACE;

Message 5 of 10

pendean
Community Legend
Community Legend
If an abbreviation does not work, why not just use the full command name instead?
0 Likes
Message 6 of 10

reuter.philipp
Enthusiast
Enthusiast

Yes, _MSPACE;_UCS;_W;_DVIEW;;_TW;270;;_UCS;_P;_PSPACE; produces the same result like _MVSETUP;_A;_R;0,0,0;-90;;; but I should be able to use it for all and I originally wanted it to rotate the view 90 degrees clockwise, currently I need to set up 4 buttons to switch between the 4 views (N: 0, E: 90, S: 180, W: 270).

 

But thanks for the help!

 

Regards,
Philip

0 Likes
Message 7 of 10

johnyDFFXO
Advocate
Advocate
Accepted solution

Ok then, that's new. How about the old-fashioned approach...

_MSPACE;_UCS;_Z;90;_PLAN;;_PSPACE;

 

PLAN might not be needed if you use UCSFOLLOW...

0 Likes
Message 8 of 10

Sea-Haven
Mentor
Mentor

Maybe look at Angdir variable as default is set to Counter clockwise. 0 or 1. 

0 Likes
Message 9 of 10

reuter.philipp
Enthusiast
Enthusiast

Yes, that was exactly what I was looking for, I removed the _PSPACE; because I want to stay in the current view, so my macros are:

  • _MSPACE;_UCS;_Z;90;_PLAN;; -> Rotates the viewport 90 degrees clockwise
  • _MSPACE;_UCS;_Z;180;_PLAN;; -> Rotates the viewport 180 degrees clockwise
  • _MSPACE;_UCS;_Z;270;_PLAN;; -> Rotates the viewport 270 degrees clockwise

Thanks for the help and also to everyone else for their time!

 

Best regards,

Philip

0 Likes
Message 10 of 10

Sea-Haven
Mentor
Mentor

My $0.05

Save this as a lsp file eg mylisp.lsp

 

(defun c:AHdoro ( / ans )
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(setq ans (atof (ah:butts 2 "V" '("Choose a angle " "45" "90" "135" "180" "225" "270" "315" "other")))) ; ans holds the button picked as an integer value
(command "_MSPACE" "_UCS" "_Z" ans "_PLAN" "")
(princ)
)
(c:AHdoro)

 

Your macro is (load "mylisp") ahdoro

SeaHaven_0-1687479492974.png