Have not used lisp in ages...
Working with viewports...
I want to make active the viewport in the layout I am working in.
Automatically select the only viewport I have within the layout
Zoom to any scale in which I am prompted.
Deactivate the viewport
Then regenall
Below is a "very" basic routine (almost embarrased to show) but hopefully it will demonstrate what I am wanting to do.
Note: The red text is the the code I am having difficulties with. I have seem many variations where developers have code to turn on or off the viewports but have not been able to translate it into my existing routine... I just don't have a high enough level of understanding ActiveX or AutoLISP. I tried using MSPACE and VPORTS commands (to toggle and or turn on/off) in my code but was not successful...
Note: There is only one viewport in layout....
(defun c:zxp ()
;;;;MSPACE active (code needed)
(setq myxp (getstring "Enter Scale Factor: "))
(command "zoom" (strcat "1/" myxp "XP"))
;;;;VPORT deactivated (code needed)
(command "regenall")
)
Hope someone can help thanks!!!
Cheers