- 积分
- 13742
- 明经币
- 个
- 注册时间
- 2016-12-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
;;;适用于天正给排水的,布局关视口By FireflyButler
(defun c:sk (/ tuceng)
(command "_.undo" "be")
(setvar "cmdecho" 0)
(setq tuceng (getvar "clayer"))
(foreach n '("zll-废水" "zll-给水" "zll-通气" "zll-热水" "zll-雨水" "zll-回水" "zll-消防" "zll-中水" "zll-喷淋" "zll-地漏" "zll-消火栓" "zll-灭火器")(xjtc n))
(setvar "clayer" tuceng)
(setq layer1 "*喷淋*,*喷头*,*雨水*,*喷头*,*中水*,*污水*,*废水*,*通气*,*地漏*")
;;保留给水及消火栓,关掉喷淋
(setq layer2
"*给水*,*消防*,*回水*,*消火栓*,*灭火器*,*喷淋*,*喷头*,*中水*"
)
;;保留排水
(setq layer3
"*给水*,*回水*,*污水*,*废水*,*消防*,*消火栓*,*灭火器*,*中水*,*雨水*,*通气*,*地漏*"
)
;;保留喷淋
(initget "GS PS ZP R")
(if (not
(setq kword
(getkword
"\n输入保留的图层:冷热水消防(GS),排水(PS),自动喷淋(ZP),重置视口(R)"
)
)
)
(setq kword "GS")
)
(cond
((= kword "GS") (command "vplayer" "f" layer1 "c" ""))
((= kword "PS") (command "vplayer" "f" layer2 "c" ""))
((= kword "ZP") (command "vplayer" "f" layer3 "c" ""))
((= kword "R") (command "vplayer" "r" "*" "c" ""))
)
(command "-purge" "la" "zll-*" "n")
(command "_.undo" "end")
(setvar "cmdecho" 1)
(princ)
)
(defun xjtc (xtcm) ;创建图层函数,可以先判断是否存在
(if
(null (tblsearch "layer" xtcm))
(entmake (list '(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
'(6 . "continuous")
'(62 . 7)
'(370 . 0)
'(70 . 0)
'(290 . 1)
(cons 2 xtcm)
)
)
;6组码【线型】,62组码【颜色】,370组码【线宽】,70组码【可见】,290组码【打印】,2组码【图层名称】
)
(prin1)
)
)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
希望大神完善 不同的视口 可以关闭自己想关闭的图层 而不影响其他视口
|
|