(defun C:lva (/ kw kval doc adoc lao cnt inc cvprt blk pw) ;Put this lisp to Appload StartUp Suite
(vl-load-com)
(setq kval :vlax-true)
(setq doc (vlax-get-object "AutoCad.Application")
adoc (vla-get-ActiveDocument doc)
lao (vla-get-Layouts adoc)
cnt (vla-get-Count lao)
inc 0
)
(repeat cnt
(setq cvprt (vla-Item lao inc)
inc (+ inc 1)
blk (vla-get-Block cvprt)
)
(vlax-for itm blk
(if
(vlax-property-available-p itm 'DisplayLocked)
(progn
(vla-put-DisplayLocked itm kval)
(vla-update itm)
)
)
)
)
(princ)
)

(vl-load-com)
(defun chspce ()
(if (not ch_spce)
(setq
ch_spce (vlr-sysvar-reactor
nil
'((:vlr-sysvarchanged . yourlispnamegoeshere))
) ;_ end_vlr-sysvar-reactor
) ;_ end_setq
) ;_ end_if
) ;_ end_defun
(chspce)

(defun yourlispnamegoeshere (event parameter)
(If (eq (car parameter) "CVPORT")
(c:lva)
) ;_ end_If
) ;_ end_defun

Advertisements