- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've written a routine that I cant seem to get to work properly. I think I may need to use a COND statement instead of the way I have it written currently. I want the lisp to deactivate the viewport only if all 3 expressions? are True. If one is false, I don't want anything to happen, but i'm not sure how to link them together. Any tips on this would be appreciated.
(defun c:vptest ()
(if (= (getvar "ctab") "Layout")) ; check to see if in layout tab (if true)
(ssget "x" (list '(0 . "VIEWPORT"))))) ; check to see if viewport is present (if true)
(= 2 (getvar 'cvport))) ; Check to see if MSPACE is active in the Layout Tab (if true, then deactivate viewport)
(progn
(command "._pspace") ; Deactivates Viewport if MSPACE is active
(princ "\n Viewport deactivated...") ; User notification
)
(progn
(princ "\n false")
)
) ;end if
(princ)
)
Solved! Go to Solution.