批量锁定和解锁视口
;本程序用于锁定/解锁布局中所有视口
(defun c:lockAllViewports()
(setq SS (SSGET "x" (LIST '(0 . "VIEWPORT") )))
;(setq SS (SSGET "x" '(0 . "VIEWPORT")))
(if ss
(progn
(setq i -1 n (sslength ss))
(while (< (setq i (1+ i)) n)
(setq ename (ssname ss i))
(setq enobj (vlax-ename->vla-object ename))
;(setq edata (entget ename))
(vlax-put-property enobj "DisplayLocked" :vlax-true)
)
)
)
(print "视口已锁定")
(princ)
)
(defun c:unlockAllViewports()
(setq SS (SSGET "x" (LIST '(0 . "VIEWPORT") )))
;(setq SS (SSGET "x" '(0 . "VIEWPORT")))
(if ss
(progn
(setq i -1 n (sslength ss))
(while (< (setq i (1+ i)) n)
(setq ename (ssname ss i))
(setq enobj (vlax-ename->vla-object ename))
;(setq edata (entget ename))
(vlax-put-property enobj "DisplayLocked" :vlax-false)
)
)
)
(print "视口已解锁")
(princ)
)
谢谢楼主分享 也可以看看这个,start4444大佬的代码。
见以下地址:
http://bbs.mjtd.com/thread-186789-1-1.html
感谢大佬的分享 感谢非常好用 参数类型错误: lentityp nil
报错
页:
[1]