Enter a viewport using Autolisp

Enter a viewport using Autolisp

christian_paulsen98V29
Enthusiast Enthusiast
793 Views
2 Replies
Message 1 of 3

Enter a viewport using Autolisp

christian_paulsen98V29
Enthusiast
Enthusiast

This sounds like a very simple thing to do but i cannot find any information online. I want to include in my code an option to click into a viewport, or "activate a viewport".

Ive tried using the "mspace" command but that just enters the most recently used viewport, it doesnt let you select a viewport. Any ideas?

0 Likes
794 Views
2 Replies
Replies (2)
Message 2 of 3

pendean
Community Legend
Community Legend
0 Likes
Message 3 of 3

andkal
Collaborator
Collaborator

This code will work with normal viewports. For clipped viewports you would have to modify the code to pick the viewport and not a clipping object.

(setq Viewport1 (car(entsel ) ))
(setq vpnum (cdr (assoc 69 (entget Viewport1 ) )  ) )
(vl-cmdf "_.mspace")
(setvar "CVPORT" vpnum)

 

 


• www.autolisps.blogspot.com - Productivity plugins for Autocad and Autocad MEP
• Autodesk AppStore
0 Likes