PDA

View Full Version : Lock Vport Lisp


BCrouse
2005-10-18, 04:39 PM
Is there a lisp out there that can lock all vports on all tabs at one time?

Thank you,
Brad

truevis
2005-10-18, 04:45 PM
;;;vpl = view port lock
;;;vpu = view port unlock

(defun c:vpu (/ lay ent)
(vlax-for lay
(vla-get-layouts
(vla-get-activedocument (vlax-get-acad-object))
)
(if (eq :vlax-false (vla-get-modeltype lay))
(vlax-for ent (vla-get-block lay)
(if (= (vla-get-objectname ent) "AcDbViewport")
(vla-put-displaylocked ent :vlax-false)
)
)
)
)
(princ "\nAll viewports in drawing are unlocked.")
(princ)
)

(defun c:vpl (/ lay ent)
(vlax-for lay
(vla-get-layouts
(vla-get-activedocument (vlax-get-acad-object))
)
(if (eq :vlax-false (vla-get-modeltype lay))
(vlax-for ent (vla-get-block lay)
(if (= (vla-get-objectname ent) "AcDbViewport")
(vla-put-displaylocked ent :vlax-true)
)
)
)
)
(princ "\nAll viewports in drawing are locked.")
(princ)
)

Mike.Perry
2005-10-18, 05:07 PM
Is there a lisp out there that can lock all vports on all tabs at one time?Hi

Honestly the forum search (http://forums.augi.com/search.php?) facility is a wonderful tool...

(http://facility%20is%20a%20wonderful%20tool...%3Cbr%20/%3E%0A%20%3Cbr%20/%3E%0A%20%5Burl=http://forums.augi.com/showthread.php?t=6282%5DLocking%20Viewports)Locking Viewports (http://forums.augi.com/showthread.php?t=6282) - took less time to find a suitable thread, than write this post.

Have a good one, Mike

ccowgill
2005-10-19, 11:31 AM
Is there a lisp out there that can lock all vports on all tabs at one time?

Thank you,
Brad

check the AUGI Exchange