- 积分
- 8585
- 明经币
- 个
- 注册时间
- 2019-6-5
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2020-9-10 15:21:15
|
显示全部楼层
大侠,我增加了图层锁定,但是对于视口图层的冻结不知道该怎么弄的
比如下面这个,如何不用command表达呢
;; 冻结排水层
(defun c:55pp()
(setvar "cmdecho" 0)
(command "_.vplayer" "F" "WP_P,WP_P_*,WP_S,WP_S_*,WP_Y,WP_Y_*,WP_YP,WP_YP_*,WP_YY,WP_YY_*,WP_YF,WP_YF_*,WP_W2,WP_W2_*,WP_YT,WP_YT_*,WP_KTN,WP_KTN_*" )
(command "" ""))
;;锁定图层
;;参数:图层名称表
(defun try-Layer-Lock (LayList)
(setq LayList(mapcar 'strcase LayList))
(vlax-for each *LAYS*
(if (member (strcase (vla-get-name each)) LayList)
(if (vlax-write-enabled-p each)
(vla-put-lock each :vlax-True)
)
)
(vlax-release-object each)
)
)
;;解锁图层
;;参数:图层名称表
(defun try-Layer-UnLock (LayList)
(setq LayList(mapcar 'strcase LayList))
(vlax-for each *LAYS*
(if (member (strcase (vla-get-name each)) LayList)
(if (vlax-write-enabled-p each)
(vla-put-lock each :vlax-False)
)
)
(vlax-release-object each)
)
)
;;锁定图层
;;参数:字符串,支持通配符
(defun try-Layer-Lock-2 (layer)
(try-Layer-Lock(vl-remove-if-not '(lambda(x)(wcmatch x layer))(try-Layer-allname)))
)
;;解锁图层
;;参数:字符串,支持通配符
(defun try-Layer-Unlock-2 (layer)
(try-Layer-Unlock(vl-remove-if-not '(lambda(x)(wcmatch x layer))(try-Layer-allname)))
)
(defun c:sf1()
(try-Layer-Lock-2 "*")
(try-Layer-Unlock-2 "WP_*,DN_*,LGBH_*,TXT_*,EV_*,W-DIM,W_DIM,WW_*,WX-*,SB,SB_*,PUB_TABLE,PUB_W-DIM,0,WX_J")
(try-Layer-On-2 "*")
(command "regen")
) |
|