求三个类似源泉图层、填充、线型的控制面板?
本帖最后由 zilong136 于 2024-1-2 15:10 编辑要求类似源泉这种图层面板样式,可自定义图层、颜色、线型、线宽、打印情况以及图层快捷键。要求通过双击面板或输入对应快捷键后,再去点击需要更改的对象都可以生效。
1. 建图层列表(越详细越好),一个命令加载这些图层,一个命令恢复修改这些图层参数。
2. 建一个模版dwt图纸,在图纸空间分类好图层设定(layerstate),如颜色,线型。
使用上基本没烦恼
(defun c:l1( / doc lay)
(vl-load-com)
(setq doc (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument))
(foreach lt '("A-虚线" "A-双点划线" "A-三点划线" "A-点划线" "A-点线")
(if (not (tblsearch "ltype" lt))
(Vlax-Invoke-Method (Vlax-Get doc 'Linetypes) 'Load lt "x1.lin" )
)
)
(foreach lst '(
("DEFPOINTS" 164 "Continuous");;55
("0-PS-标注-尺寸" 127 "A-虚线");;88
("0-PS-标注-门编号" 2 "Continuous");;0drt
("0-PS-标注-软装编号" 21 "A-虚线");;
("0-PS-标注-索引" 127 "Continuous");;
("0-PS-标注-文字" 127 "A-虚线");;0t
("0-PS-标注-五金洁具" 127 "A-虚线");;
("0-PS-辅助线" 1 "A-虚线");;0w3
("0-管井" 251 "Continuous");;gj
("0-建筑标高" 3 "Continuous");;0bg
("0-建筑地漏" 1 "Continuous");;0dl
("0-建筑栏杆" 1 "Continuous");;0lg
("0-建筑立管" 1 "Continuous");;0wt
("0-梁位" 161 "Continuous");;
("0-梁位文字" 161 "Continuous");;
("0-文字" 1 "A-虚线");;
("0-消防层" 6 "Continuous");;
("0-消火栓" 1 "Continuous");;
("0-原建筑窗" 3 "Continuous");;0wd
("0-原建筑门" 3 "Continuous");;0dr
("0-建筑墙" 7 "Continuous");;0wa
("0-轴线" 1 "A-点划线");;zx
("LIFT" 3 "A-虚线");;
("STAIR" 3 "Continuous");;
("FIN" 1 "A-虚线");;
("COLUMN" 252 "Continuous");;0z
("COL_FILL" 252 "Continuous");;
("DOOR" 3 "Continuous");;
("DOOR-门套" 3 "Continuous");;
("WALL" 7 "Continuous");;waa
("WALL" 7 "Continuous");;waa
("WALL-不到顶间墙" 2 "Continuous");;
("WALL-新砌墙体" 7 "Continuous");;
("WALL-填充" 252 "Continuous");;
("WINDOW" 3 "Continuous");;
("P-玻璃间隔" 3 "Continuous");;wdd
("P-玻璃间隔" 1 "Continuous");;wddd
("WINDOW_TEXT" 8 "Continuous");;
("构造线层" 2 "Continuous");;
("BALCONY" 1 "Continuous");;0y阳台
("AREA" 6 "A-虚线");;
("AXIS" 8 "Continuous");;ax
("P-窗帘" 14 "Continuous");;
("P-固定家具(不落地不到顶);;" 3 "Continuous");;
("P-固定家具(不落地到顶);;" 3 "Continuous");;
("P-固定家具(落地);;" 3 "Continuous");;
("P-固定家具(落地到顶);;" 3 "Continuous");;
("P-固定家具(细);;(不落地不到顶);;" 251 "A-虚线");;
("P-固定家具(细);;(不落地到顶);;" 251 "A-虚线");;
("P-固定家具(细);;(落地);;" 251 "A-虚线");;
("P-固定家具(细);;(落地到顶);;" 251 "A-虚线");;
("P-活动家具" 3 "A-虚线");;
("P-活动家具(细);;" 251 "A-虚线");;
("P-洁具(不落地);;" 31 "Continuous");;
("P-洁具(落地);;" 41 "Continuous");;
("P-洁具(吸顶);;" 43 "Continuous");;
("P-洁具(细);;(不落地);;" 251 "Continuous");;
("P-洁具(细);;(落地);;" 251 "Continuous");;
("P-洁具(细);;(吸顶);;" 251 "Continuous");;
("P-栏杆" 1 "Continuous");;
("P-平面标高" 127 "Continuous");;
("P-文字(区域名称);;" 40 "Continuous");;
("P-文字(说明);;" 42 "A-虚线");;
("P-造型完成面" 6 "Continuous");;
("P-植物" 95 "Continuous");;
("P-植物(细);;" 252 "Continuous");;
("PL-壁灯" 41 "Continuous");;
("PL-平面灯具" 41 "Continuous");;
("PL-平面灯具编号" 1 "Continuous");;
("GLASS" 1 "Continuous");;
("B-拆除墙体" 1 "A-虚线");;
("B-拆除墙体填充" 251 "Continuous");;
("B-新起间墙填充" 251 "Continuous");;
("C-风口" 1 "Continuous");;
("C-天花" 2 "Continuous");;
("C-天花-(浅);;" 3 "Continuous");;
("C-天花-摄像头" 146 "Continuous");;
("C-天花-背景音乐" 104 "Continuous");;
("C-天花标高" 181 "Continuous");;
("C-天花灯具" 41 "A-双点划线");;
("C-天花灯具编号" 1 "A-双点划线");;
("C-天花风口" 3 "Continuous");;
("C-天花-监控" 86 "Continuous");;
("C-天花门线" 1 "Continuous");;
("C-天花-喷淋" 102 "Continuous");;
("C-天花填充" 251 "Continuous");;
("C-天花文字" 127 "A-虚线");;
("C-天花-消防广播" 104 "Continuous");;
("C-天花-烟感" 134 "Continuous");;
("C-天花造型大样" 144 "Continuous");;
("FL-地花" 3 "Continuous");;
("FL-地花-防水" 2 "A-虚线");;
("FL-地花填充" 251 "Continuous");;
("FL-地花造型大样" 144 "Continuous");;
("FL-文字" 127 "A-虚线");;
("DS-LX-插座(强电);;连线" 4 "A-三点划线");;
("DS-LX-插座(弱电);;连线" 4 "A-三点划线");;
("DS-LX-平面灯具连线" 4 "A-三点划线");;
("DS-LX-天花灯具连线" 4 "A-三点划线");;
("DS-插座(强电);;" 93 "Continuous");;
("DS-插座(弱电);;" 155 "Continuous");;
("DS-电箱层" 11 "Continuous");;
("DS-开关" 3 "Continuous");;
("SS-地漏" 251 "Continuous");;
("SS-给水" 3 "Continuous");;
("SS-给水(冷);;" 4 "Continuous");;
("SS-给水(热);;" 1 "Continuous");;
("SS-排水" 4 "Continuous");;
("SS-水点位" 2 "Continuous");;
("DT-壁纸&乳胶漆" 2 "A-虚线");;
("DT-玻璃&镜子" 2 "Continuous");;
("DT-玻璃&镜子填充" 237 "Continuous");;
("DT-基层" 1 "Continuous");;
("DT-基层填充" 237 "Continuous");;
("DT-结构" 7 "Continuous");;
("DT-结构填充" 252 "Continuous");;
("DT-金属" 2 "Continuous");;
("DT-金属填充" 237 "Continuous");;
("DT-木" 2 "Continuous");;
("DT-木饰面" 2 "Continuous");;
("DT-木填充" 237 "Continuous");;
("DT-皮布" 2 "Continuous");;
("DT-皮布填充" 237 "Continuous");;
("DT-砌筑" 4 "Continuous");;
("DT-砌筑填充" 252 "Continuous");;
("DT-石材" 2 "Continuous");;
("DT-石材填充" 237 "Continuous");;
("DT-石膏" 2 "Continuous");;
("DT-石膏填充" 237 "Continuous");;
("DT-粘胶" 252 "Continuous");;
("EL-结构" 7 "Continuous");;
("EL-结构填充" 128 "Continuous");;
("EL-立面机电" 135 "Continuous");;
("EL-立面填充" 251 "Continuous");;
("EL-立面造型" 1 "Continuous");;
("EL-砌筑" 4 "Continuous");;
("EL-砌筑填充" 128 "Continuous");;
("EL-完成面" 2 "Continuous");;
)
(setq lay (Vla-Add (Vlax-Get doc 'Layers) (car lst) ))
(Vlax-Put-Property lay 'Color (cadr lst) )
(Vlax-Put-Property lay 'Linetype (caddr lst) )
)
(princ)
)
(defun c:l2 ();;图层重调整
(change_layer_dxf "DEFPOINTS" '((62 . 164) (6 . "Continuous")))
(change_layer_dxf "0-PS-标注-尺寸" '((62 . 151) (6 . "A-虚线")))
(change_layer_dxf "0-PS-标注-门编号" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "0-PS-标注-软装编号" '((62 . 21) (6 . "A-虚线")))
(change_layer_dxf "0-PS-标注-索引" '((62 . 151) (6 . "Continuous")))
(change_layer_dxf "0-PS-标注-文字" '((62 . 151) (6 . "A-虚线")))
(change_layer_dxf "0-PS-标注-五金洁具" '((62 . 151) (6 . "A-虚线")))
(change_layer_dxf "0-PS-辅助线" '((62 . 1) (6 . "A-虚线")))
(change_layer_dxf "0-管井" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "0-建筑标高" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "0-建筑地漏" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "0-建筑栏杆" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "0-建筑立管" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "0-梁位" '((62 . 161) (6 . "Continuous")))
(change_layer_dxf "0-梁位文字" '((62 . 161) (6 . "Continuous")))
(change_layer_dxf "0-文字" '((62 . 1) (6 . "A-虚线")))
(change_layer_dxf "0-消防层" '((62 . 6) (6 . "Continuous")))
(change_layer_dxf "0-消火栓" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "0-原建筑窗" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "0-原建筑门" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "0-轴线" '((62 . 1) (6 . "A-点划线")))
(change_layer_dxf "LIFT" '((62 . 3) (6 . "A-虚线")))
(change_layer_dxf "STAIR" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "FIN" '((62 . 1) (6 . "A-虚线")))
(change_layer_dxf "COLUMN" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "COL_FILL" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "DOOR" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "DOOR-门套" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "WALL" '((62 . 7) (6 . "Continuous")))
(change_layer_dxf "WALL-不到顶间墙" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "WALL-新砌墙体" '((62 . 7) (6 . "Continuous")))
(change_layer_dxf "WALL-填充" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "WINDOW" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "WINDOW_TEXT" '((62 . 8) (6 . "Continuous")))
(change_layer_dxf "构造线层" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "BALCONY" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "AREA" '((62 . 6) (6 . "A-虚线")))
(change_layer_dxf "AXIS" '((62 . 8) (6 . "Continuous")))
(change_layer_dxf "P-窗帘" '((62 . 14) (6 . "Continuous")))
(change_layer_dxf "P-固定家具(不落地不到顶)" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "P-固定家具(不落地到顶)" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "P-固定家具(落地)" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "P-固定家具(落地到顶)" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "P-固定家具(细)(不落地不到顶)" '((62 . 251) (6 . "A-虚线")))
(change_layer_dxf "P-固定家具(细)(不落地到顶)" '((62 . 251) (6 . "A-虚线")))
(change_layer_dxf "P-固定家具(细)(落地)" '((62 . 251) (6 . "A-虚线")))
(change_layer_dxf "P-固定家具(细)(落地到顶)" '((62 . 251) (6 . "A-虚线")))
(change_layer_dxf "P-活动家具" '((62 . 3) (6 . "A-虚线")))
(change_layer_dxf "P-活动家具(细)" '((62 . 251) (6 . "A-虚线")))
(change_layer_dxf "P-洁具(不落地)" '((62 . 31) (6 . "Continuous")))
(change_layer_dxf "P-洁具(落地)" '((62 . 41) (6 . "Continuous")))
(change_layer_dxf "P-洁具(吸顶)" '((62 . 43) (6 . "Continuous")))
(change_layer_dxf "P-洁具(细)(不落地)" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "P-洁具(细)(落地)" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "P-洁具(细)(吸顶)" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "P-栏杆" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "P-平面标高" '((62 . 151) (6 . "Continuous")))
(change_layer_dxf "P-文字(区域名称)" '((62 . 40) (6 . "Continuous")))
(change_layer_dxf "P-文字(说明)" '((62 . 42) (6 . "A-虚线")))
(change_layer_dxf "P-造型完成面" '((62 . 6) (6 . "Continuous")))
(change_layer_dxf "P-植物" '((62 . 95) (6 . "Continuous")))
(change_layer_dxf "P-植物(细)" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "PL-壁灯" '((62 . 41) (6 . "Continuous")))
(change_layer_dxf "PL-平面灯具" '((62 . 41) (6 . "Continuous")))
(change_layer_dxf "PL-平面灯具编号" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "GLASS" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "B-拆除墙体" '((62 . 1) (6 . "A-虚线")))
(change_layer_dxf "B-拆除墙体填充" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "B-新起间墙填充" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "C-风口" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "C-天花" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "C-天花-(浅)" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "C-天花-摄像头" '((62 . 146) (6 . "Continuous")))
(change_layer_dxf "C-天花-背景音乐" '((62 . 104) (6 . "Continuous")))
(change_layer_dxf "C-天花标高" '((62 . 181) (6 . "Continuous")))
(change_layer_dxf "C-天花灯具" '((62 . 41) (6 . "A-双点划线")))
(change_layer_dxf "C-天花灯具编号" '((62 . 1) (6 . "A-双点划线")))
(change_layer_dxf "C-天花风口" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "C-天花-监控" '((62 . 86) (6 . "Continuous")))
(change_layer_dxf "C-天花门线" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "C-天花-喷淋" '((62 . 102) (6 . "Continuous")))
(change_layer_dxf "C-天花填充" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "C-天花文字" '((62 . 151) (6 . "A-虚线")))
(change_layer_dxf "C-天花-消防广播" '((62 . 104) (6 . "Continuous")))
(change_layer_dxf "C-天花-烟感" '((62 . 134) (6 . "Continuous")))
(change_layer_dxf "C-天花造型大样" '((62 . 144) (6 . "Continuous")))
(change_layer_dxf "FL-地花" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "FL-地花-防水" '((62 . 2) (6 . "A-虚线")))
(change_layer_dxf "FL-地花填充" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "FL-地花造型大样" '((62 . 144) (6 . "Continuous")))
(change_layer_dxf "FL-文字" '((62 . 151) (6 . "A-虚线")))
(change_layer_dxf "DS-LX-插座(强电)连线" '((62 . 4) (6 . "A-三点划线")))
(change_layer_dxf "DS-LX-插座(弱电)连线" '((62 . 4) (6 . "A-三点划线")))
(change_layer_dxf "DS-LX-平面灯具连线" '((62 . 4) (6 . "A-三点划线")))
(change_layer_dxf "DS-LX-天花灯具连线" '((62 . 4) (6 . "A-三点划线")))
(change_layer_dxf "DS-插座(强电)" '((62 . 93) (6 . "Continuous")))
(change_layer_dxf "DS-插座(弱电)" '((62 . 155) (6 . "Continuous")))
(change_layer_dxf "DS-电箱层" '((62 . 11) (6 . "Continuous")))
(change_layer_dxf "DS-开关" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "SS-地漏" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "SS-给水" '((62 . 3) (6 . "Continuous")))
(change_layer_dxf "SS-给水(冷)" '((62 . 4) (6 . "Continuous")))
(change_layer_dxf "SS-给水(热)" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "SS-排水" '((62 . 4) (6 . "Continuous")))
(change_layer_dxf "SS-水点位" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-壁纸&乳胶漆" '((62 . 2) (6 . "A-虚线")))
(change_layer_dxf "DT-玻璃&镜子" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-玻璃&镜子填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-基层" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "DT-基层填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-结构" '((62 . 7) (6 . "Continuous")))
(change_layer_dxf "DT-结构填充" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "DT-金属" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-金属填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-木" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-木饰面" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-木填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-皮布" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-皮布填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-砌筑" '((62 . 4) (6 . "Continuous")))
(change_layer_dxf "DT-砌筑填充" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "DT-石材" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-石材填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-石膏" '((62 . 2) (6 . "Continuous")))
(change_layer_dxf "DT-石膏填充" '((62 . 237) (6 . "Continuous")))
(change_layer_dxf "DT-粘胶" '((62 . 252) (6 . "Continuous")))
(change_layer_dxf "EL-结构" '((62 . 7) (6 . "Continuous")))
(change_layer_dxf "EL-结构填充" '((62 . 128) (6 . "Continuous")))
(change_layer_dxf "EL-立面机电" '((62 . 135) (6 . "Continuous")))
(change_layer_dxf "EL-立面填充" '((62 . 251) (6 . "Continuous")))
(change_layer_dxf "EL-立面造型" '((62 . 1) (6 . "Continuous")))
(change_layer_dxf "EL-砌筑" '((62 . 4) (6 . "Continuous")))
(change_layer_dxf "EL-砌筑填充" '((62 . 128) (6 . "Continuous")))
(change_layer_dxf "EL-完成面" '((62 . 2) (6 . "Continuous")))
) 本帖最后由 zilong136 于 2024-2-5 02:35 编辑
alexmai 发表于 2024-1-31 13:48
1. 建图层列表(越详细越好),一个命令加载这些图层,一个命令恢复修改这些图层参数。
2. 建一个模版dwt ...
[*]帮我看下这怎么改?
[*]
[*](defun c:w5( / doc lay)
[*](vl-load-com)
[*](setq doc (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument))
[*](foreach lt '("A-虚线" "A-双点划线" "A-三点划线" "A-点划线" "A-点线")
[*] (if (not (tblsearch "ltype" lt))
[*] (Vlax-Invoke-Method (Vlax-Get doc 'Linetypes) 'Load lt "D:\CAD线型\acadiso.lin");此处需要acadiso.lin线型文件
[*] )
[*])
[*](foreach lst (list
[*]
[*] '("0" 7 "Continuous" 25))
[*] '("Defpoints" 7 "Continuous" 25)
[*] '("0-轴线" 251 "DOTE" 5))
[*]'("0-标注" 3 "Continuous" 25))
[*]'( "0-文字说明" 7 "Continuous" 25))
[*]
[*]'("1-梁枋" 2 "Continuous" 25)
[*]'( "1-梁枋-原有" 2 "Continuous" 25)
[*]'("1-梁枋-新建" 2 "Continuous" 25)
[*]
[*]'("2-墙体" 7 "Continuous" 25)
[*]'( "2-墙体-原有" 7 "Continuous" 0.25)
[*]'("2-墙体-新建" 7 "Continuous" 0.25)
[*]
[*]'( "3-柱子" 7 "Continuous" 0.25)
[*]'("3-柱子-原有" 7 "Continuous" 0.25)
[*]'("3-柱子-新建" 7 "Continuous" 0.25)
[*]
[*]'("3-柱子-柱顶石" 136 "Continuous" 25)
[*]'("3-柱子-柱顶石-原有" 136 "Continuous" 25)
[*]'( "3-柱子-柱顶石-新建" 136 "Continuous" 25)
[*]
[*]'("4-门窗" 4 "Continuous" 25)
[*]'( "4-门窗-原有" 4 "Continuous" 25)
[*]'( "4-门窗-新建" 4 "Continuous" 25)
[*]
[*]'("5-楼枕、楼板" 11 "Continuous" 25)
[*]'("5-楼枕、楼板-原有" 11 "Continuous" 25)
[*]'( "5-楼枕、楼板-新建" 11 "Continuous" 25)
[*]
[*]'( "6-檩条" 40 "Continuous" 25)
[*]'( "6-檩条-原有" 40 "Continuous" 25)
[*]'("6-檩条-新建" 40 "Continuous" 25)
[*]
[*]'("7-木桷板" 30 "Continuous" 25)
[*]'("7-木桷板-原有" 30 "Continuous" 25)
[*]'( "7-木桷板-新建" 30 "Continuous" 25)
[*]
[*]'( "8-屋面" 4 "Continuous" 25)
[*]'( "8-屋面-原有" 4 "Continuous" 25)
[*]'( "8-屋面-新建" 4 "Continuous" 25)
[*]
[*]'("0-填充" 251 "Continuous" 5)
[*]'( "0-填充-原有" 251 "Continuous" 5)
[*]'( "0-填充-新建" 251 "Continuous" 5)
[*]
[*]'("0-斗拱" 7 "Continuous" 25)
[*]'( "0-斗拱-原有" 7 "Continuous" 25)
[*]'( "0-斗拱-新建" 7 "Continuous" 25)
[*]
[*]'( "0-椽条" 61 "Continuous" 25)
[*]'("0-椽条-原有" 61 "Continuous" 25)
[*]'("0-椽条-新建" 61 "Continuous" 25)
[*]
[*]'("0-构件" 7"Continuous" 25)
[*]'( "0-构件-原有" 7 "Continuous" 25)
[*]'("0-构件-新建" 7 "Continuous" 25)
[*]
[*]'("0-楼梯" 4 "Continuous" 25)
[*]'("0-楼梯-原有" 4"Continuous" 25)
[*]'( "0-楼梯-新建" 4 "Continuous" 25)
[*]
[*]'( "0-瓦" 251"Continuous" 5)
[*]'( "0-瓦-原有" 251"Continuous" 5)
[*]'("0-瓦-新建" 251 "Continuous" 5)
[*];按上面格式自行添加图层信息(图层名 颜色 线型 线宽),注:此处线宽需将真实线宽乘以100!
[*])
[*](setq lay (Vla-Add (Vlax-Get doc 'Layers) (car lst)))
[*](Vlax-Put-Property lay 'Color (cadr lst))
[*](Vlax-Put-Property lay 'Linetype (caddr lst))
[*](Vlax-Put-Property lay 'Lineweight (cadddr lst))
[*])
[*](princ)
[*])
[*]
[*]
[*]
[*];;修改图层子函数
[*];;2图层名,62颜色,6线型,370线宽,290打印标记为0时不打印此图层,
[*];;70标准标记1=冻结图层,2=默认情况下在新视口中冻结图层,4=锁定图层
[*](defun change_layer_dxf ( layer_name subst_lists / layer_en ent_list subst_list)
[*](if (setqlayer_en(tblobjname"layer"layer_name))
[*] (progn
[*] (setqent_list (entget layer_en))
[*] (foreach subst_listsubst_lists
[*] (setq ent_list(subst subst_list (assoc (car subst_list) ent_list) ent_list))
[*] )
[*] (entmod ent_list)
[*] (entupd layer_en)
[*] )
[*] (alert (strcat "未找到"layer_name "图层"))
[*])
[*](princ)
[*])
[*](defun c:w6 ();;图层重调整
[*] (change_layer_dxf "0" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 1)))
[*] (change_layer_dxf "Defpoints" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-轴线" '((62 . 251) (6 . "DOTE")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-标注" '((62 . 3) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-文字说明" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "1-梁枋" '((62 . 2) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "1-梁枋-原有" '((62 . 2) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "1-梁枋-新建" '((62 . 2) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "2-墙体" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "2-墙体-原有" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "2-墙体-新建" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "3-柱子" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "3-柱子-原有" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "3-柱子-新建" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "3-柱子-柱顶石" '((62 . 136) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "3-柱子-柱顶石-原有" '((62 . 136) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "3-柱子-柱顶石-新建" '((62 . 136) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "4-门窗" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "4-门窗-原有" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "4-门窗-新建" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "5-楼枕、楼板" '((62 . 11) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "5-楼枕、楼板-原有" '((62 . 11) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "5-楼枕、楼板-新建" '((62 . 11) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "6-檩条" '((62 . 40) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "6-檩条-原有" '((62 . 40) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "6-檩条-新建" '((62 . 40) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "7-木桷板" '((62 . 30) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "7-木桷板-原有" '((62 . 30) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "7-木桷板-新建" '((62 . 30) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "8-屋面" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "8-屋面-原有" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "8-屋面-新建" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "0-填充" '((62 . 251) (6 . "Continuous")(370 . 5)(290 . 0)))
[*] (change_layer_dxf "0-填充-原有" '((62 . 251) (6 . "Continuous")(370 . 5)(290 . 0)))
[*] (change_layer_dxf "0-填充-新建" '((62 . 251) (6 . "Continuous")(370 . 5)(290 . 0)))
[*]
[*] (change_layer_dxf "0-斗拱" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-斗拱-原有" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-斗拱-新建" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*]
[*] (change_layer_dxf "0-椽条" '((62 . 61) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-椽条-原有" '((62 . 61) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-椽条-新建" '((62 . 61) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "0-构件" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-构件-原有" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-构件-新建" '((62 . 7) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "0-楼梯" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-楼梯-原有" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*] (change_layer_dxf "0-楼梯-新建" '((62 . 4) (6 . "Continuous")(370 . 25)(290 . 0)))
[*]
[*] (change_layer_dxf "0-瓦" '((62 . 251) (6 . "Continuous")(370 . 5)(290 . 0)))
[*] (change_layer_dxf "0-瓦-原有" '((62 . 251) (6 . "Continuous")(370 . 5)(290 . 0)))
[*] (change_layer_dxf "0-瓦-新建" '((62 . 251) (6 . "Continuous")(370 . 5)(290 . 0)))
zilong136 发表于 2024-1-31 17:36
l2命令内缺少了一个名为change_layer_dxf的函数
;;修改图层子函数
;;2图层名,62颜色,6线型,370线宽,290打印标记为0时不打印此图层,
;;70标准标记1=冻结图层,2=默认情况下在新视口中冻结图层,4=锁定图层
(defun change_layer_dxf ( layer_name subst_lists / layer_en ent_list subst_list)
(if (setqlayer_en(tblobjname"layer"layer_name))
(progn
(setqent_list (entget layer_en))
(foreach subst_listsubst_lists
(setq ent_list(subst subst_list (assoc (car subst_list) ent_list) ent_list))
)
(entmod ent_list)
(entupd layer_en)
)
(alert (strcat "未找到"layer_name "图层"))
)
(princ)
) 命令:CLASSICLAYER alexmai 发表于 2024-1-2 09:36
命令:CLASSICLAYER
不是这个图层管理器,我是要一个能快速自己定义跟管理图层的面板,既可以通过快捷键的方式去实现,也可以通过面板的方式去实现。面板的方式是这样操作:
1、双击图层面板;
2、去图中选择更改对象。 cad自带的那个图层管理器,确实难用 哪你就用源泉就可以了嘛 yefei812678 发表于 2024-1-3 08:57
哪你就用源泉就可以了嘛
关键是源泉的面板不能直接双击去改实体对象,必须使用自定义的快捷键。我要面板跟快捷键都能用。 本帖最后由 zilong136 于 2024-2-1 04:45 编辑
alexmai 发表于 2024-1-31 13:48
1. 建图层列表(越详细越好),一个命令加载这些图层,一个命令恢复修改这些图层参数。
2. 建一个模版dwt ...
l2命令内缺少了一个名为change_layer_dxf的函数
页:
[1]
2