While in paperspace, and I double-click a viewport,
the following is displayed on the command prompt:
Command: _.MSPACE
What variable lets me know that I am now in (the viewport's) model space?
Command: _.MSPACE Command: tilemode Enter new value for TILEMODE <0>: Command: _.PSPACE Command: tilemode Enter new value for TILEMODE <0>:
Thanks in advance.
scot-65
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
This code snippet is a more complete example (one of multiple), of how to identify 'where' you are:
(if (= 1 (getvar 'tilemode)) ;; modelspace (if (= 1 (getvar 'cvport)) ;; paperspace ;; pviewport active ) )
The problem comes from CVPORT not being changed when one switches betwen Model and Layout, as TILEMODE does, which is why one must use a Command reactor to 'trace' after the active space (i.e., Model, Paper, PViewport Active) has changed.
Cheers
"How we think determines what we do, and what we do determines what we get."
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
scot-65 wrote:
(if (and (= (getvar "TILEMODE") 0)(< (getvar "CVPORT") 2));and
hmsilva wrote:
(if (and (= (getvar "TILEMODE") 0)(/= (getvar "CVPORT") 1));and
... Simpler still:
(< (getvar 'tilemode) 1 (getvar 'cvport))
"How we think determines what we do, and what we do determines what we get."
Hi guys,
Just for fun...
(defun c:WhereAmI ()
(if (and (= (getvar "TILEMODE") 1)(= (getvar "CVPORT") 2));and
(princ "\n ** You are in Model Space **")
);if
(if (and (= (getvar "TILEMODE") 0)(= (getvar "CVPORT") 1));and
(princ "\n ** You are in Paper Space **")
);if
(if (and (= (getvar "TILEMODE") 0)(> (getvar "CVPORT") 1));and
(princ "\n ** You are in an Active Viewport **")
);if
(princ)
);defun
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.