隔壁论坛淘来的好东西,希望大神完善~~~
;;;适用于天正给排水的,布局关视口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)
)
)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
http://bbs.xdcad.net/data/attachment/forum/201707/04/115254egstbtxs58rbsgsk.gif
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
希望大神完善 不同的视口可以关闭自己想关闭的图层而不影响其他视口
(command "vplayer" "f" 图层名 "" "") start4444 发表于 2019-4-10 15:05
(command "vplayer" "f" 图层名 "" "")
有完整的代码 吗我是小白啥都不懂 希望有大神能解决{:1_1:}{:1_1:}
页:
[1]