4
12
8
初来乍到
使用道具 举报
44
3166
2803
中流砥柱
(vl-load-com);;;--------------------------------------------------------------------;;;; Viewport lock(defun c:VPL () (c:ViewportLock))(defun c:ViewportLock (/ option ss) (princ "\rVIEWPORTLOCK ") (_PutPViewportLockAndColor :vlax-true 4));;;--------------------------------------------------------------------;;;; Viewport unlock(defun c:VPU () (c:ViewportUnlock))(defun c:ViewportUnlock (/ option ss) (princ "\rVIEWPORTUNLOCK ") (_PutPViewportLockAndColor :vlax-false 256));;;--------------------------------------------------------------------;;;; Put PViewport Lock and Color(defun _PutPViewportLockAndColor (lock color / *error* option ss acDoc) (defun *error* (msg) (if (and ss (= 'VLA-OBJECT (type ss))) (vla-delete ss) ) (if acDoc (vla-endundomark acDoc) ) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** " msg " ** "))) ) ; Fatal error, display it (princ) ) (if (and (not (initget "All Current")) (or (setq option (getkword "\nEnter layout(s) to modify [All/Current]<Current>: " ) ) (setq option "Current") ) (setq ss (cond ((= "Current" option) (_GetPViewports nil)) ((_GetPViewports T)) ) ) ) (progn (vla-startundomark (setq acDoc (vla-get-activedocument (vlax-get-acad-object) ) ) ) (vlax-for x (setq ss (vla-get-activeselectionset acDoc)) (vla-put-color x color) (if (vlax-property-available-p x 'displaylocked) (vla-put-displaylocked x lock) ) ) (if (= (vla-get-mspace acDoc) :vlax-true) (vla-regen acDoc acactiveviewport) ) (setq ss (vla-delete ss)) (*error* nil) ) (if option (*error* "Command not allowed in Model Tab") ) ) (princ));;;--------------------------------------------------------------------;;;; Get PViewports(defun _GetPViewports (allTabs) (ssget "_x" (list '(-4 . "<OR") '(0 . "VIEWPORT") '(-4 . "<AND") '(0 . "LWPOLYLINE") '(102 . "{ACAD_REACTORS") '(-4 . "AND>") '(-4 . "OR>") (cons 410 (cond (allTabs (vl-string-right-trim "," (apply 'strcat (mapcar '(lambda (x) (strcat x ",")) (layoutlist)) ) ) ) ((getvar 'ctab)) ) ) ) ))
本版积分规则 发表回复 回帖后跳转到最后一页
微信公众平台
扫描访问手机版
点击图片下载手机App
|关于我们|小黑屋|乐筑天下 繁体中文
GMT+8, 2025-3-10 03:46 , Processed in 0.537235 second(s), 75 queries .
© 2020-2025 乐筑天下
在线时间:10:00-17:00
暂无
扫一扫,关注我们
帮助中心
关于我们
下载APP客户端