Jump to content

Viewports - Model space vs Paperspace Active viewport


Recommended Posts

Hey everyone,


Hopefully someone can help me out here.

What I am looking to do is to create a lisp that knows the difference between regular model space, paper space and an active viewport in paper space.

I looked into cvport, but to my understanding its just a system variable for PS and MS. cvport = 1 for PS and cvport = 2 for MS

This cvport cant tell the difference between and active viewport in PS and actual MS.

The reason why I want to know the difference between the 3 is that I want to create a conditional LISP.

Run the lisp it does...

X for Model space

Y for Paper Space and 

Z for Active viewport in Paper space

I know there is a way of doing this, probably using Visual Lisp and some combination of VLA functions which I dont know very well.

Anyone have any ideas?


Link to comment
Share on other sites

You should be able to test the current document with vla-get-mspace for :vlax-true or :vlax-false. See this thread, especially Lee Mac's code. A true result means the viewport is in model-space mode. Not 100% sure about that... wait, I checked, and it works! The tilemode variable will tell you whether you're on a layout tab. That should do it.

Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...