I am trying to write a routine that will turn a viewport on or off. I know that the information is stored in xdata under the dotted pair 90 but there are 18 different options for that variable. How would I filter out the other values?
Thanks
|
I am trying to write a routine that will turn a viewport on or off. I know that the information is stored in xdata under the dotted pair 90 but there are 18 different options for that variable. How would I filter out the other values?
Thanks
A few things......the association group 90 is not a part of the extended data, but is a part of the object's data. Next, those values are bit coded values and to turn off a VP requires the bitcode value of 131072 to be set.
However, you cannot use (entmod) on a paperspace viewport.....
But, using ActiveX you CAN manipulate the Off/On value:
(setq vpObj (vlax-ename->vla-object vpEnt))
(vla-display vpObj :vlax-true);;;turns it on
(vla-display vpObj :vlax-false);;;turns it off
HTH,
Jeff
I realized i made a mistake in my first question and post. I want to know how to LOCK and UNLOCK a viewport not turn on and off. Sorry my mistake.
I found something on theswamp.org to help
http://www.theswamp.org/index.php?topic=7097.0
Look at (vla-put-DisplayLocked vpObj [:vlax-true / :vlax-false] )
PS I see you found more info.
Last edited by CAB2k; 2006-05-09 at 04:29 PM.
HiOriginally Posted by boesiii
You may also find the following thread, helpful...
Locking Viewports
Have a good one, Mike
I don't know if this helps but..
Here's a quick routine I wrote a while back to quickly lock (and unlock) several viewports at once.
TedCode:;;lock selected vports (defun c:lvp (/ ss) (setq ss (ssget)) (command "mview" "l" "on" ss "") (princ) ) ;;unlock selected vports (defun c:ulvp (/ ss) (setq ss (ssget)) (command "mview" "l" "off" ss "") (princ) ) (princ) (princ "LVP loaded.") (princ "\nType LVP, select the viewports you want to lock and then hit ENTER.") (princ "\nType ULVP, select the viewports you want to unlock and then hit ENTER.")
Ted,
Thanks for the post of the lisp routine.
That is exactly what I was looking for.
Have a great day.
Michael
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
... TILEMODE = 1?
Code:(defun c:LVP () (if (= (getvar 'TILEMODE) 0) ;if you're in paperspace (command "._mview" "_lock" "_on" "_all" "") ;then do it (princ "\n** Command not allowed in Model Tab **") ;else, announce failure ) (princ);exit cleanly ) (defun c:ULVP () (if (= (getvar 'TILEMODE) 0) ;if you're in paperspace (command "._mview" "_lock" "_off" "_all" "") ;then do it (princ "\n** Command not allowed in Model Tab **") ;else, announce failure ) (princ);exit cleanly )