DCL改变多个图层的颜色,怎么增加记忆功能?
(defun c:tt()
(setvar "cmdecho" 0)
(vl-catch-all-apply
'(lambda();出错处理
(yanse-dcl_te)
(setvar "cmdecho" 0);控制在 AutoLISP 的 command 函数运行时 AutoCAD 是否回显提示和输入:0.关闭回显 1.打开回显
(command "-layer""c" ys-1 "shuju" "");
(command "-layer""c" ys-2 "sjx" "");
(command "-layer""c" ys-3 "标尺" "");
(command "-layer""c" ys-4 "网格1" "");
(command "-layer""c" ys-5 "BPD1" "");
(command "-layer""c" ys-6 "网格" "");
(command "-layer""c" ys-7 "变坡点" "");
(command "-layer""c" ys-8 "LCZH" "");
(command "-layer""c" ys-9 "构造物" "");
(command "-layer""c" ys-10 "图框" "");
(command "-layer""c" ys-11 "超高中心" "");
(command "-layer""c" ys-12 "页码" "");
(command "-layer""c" ys-13 "栏目" "");
(command "-layer""c" ys-14 "pm" "");
(c:tc5);
(setvar "cmdecho" 1)
(princ)
(vl-file-delete Dcl_File)
(unload_dialog dcl_id)
));出错处理
(setvar "cmdecho" 1)
(princ)
)
(defun yanse-dcl_te()
(setq dcl_id (load_dialog (setq Dcl_File (yanse-dclfottext))))
(new_dialog "text2" dcl_id)
(set_tile "ys-1" "1");默认颜色
(set_tile "ys-2" "1")
(set_tile "ys-3" "5")
(set_tile "ys-4" "5")
(set_tile "ys-5" "6")
(set_tile "ys-6" "8")
(set_tile "ys-7" "11")
(set_tile "ys-8" "81")
(set_tile "ys-9" "121")
(set_tile "ys-10" "7")
(set_tile "ys-11" "11")
(set_tile "ys-12" "161")
(set_tile "ys-13" "73")
(set_tile "ys-14" "75")
(action_tile "accept" "(ys-ok_te)(done_dialog 1)")
(start_dialog)
)
(defun ys-ok_te()
(setq ys-1(get_tile "ys-1"));
(setq ys-2 (get_tile "ys-2"))
(setq ys-3 (get_tile "ys-3"))
(setq ys-4 (get_tile "ys-4"))
(setq ys-5 (get_tile "ys-5"))
(setq ys-6 (get_tile "ys-6"))
(setq ys-7 (get_tile "ys-7"))
(setq ys-8 (get_tile "ys-8"))
(setq ys-9 (get_tile "ys-9"))
(setq ys-10 (get_tile "ys-10"))
(setq ys-11 (get_tile "ys-11"))
(setq ys-12 (get_tile "ys-12"))
(setq ys-13 (get_tile "ys-13"))
(setq ys-14 (get_tile "ys-14"))
)
;写dcl
(defun yanse-dclfottext()
(setq Dcl_File (vl-filename-mktemp nil nil))
(setq lujin(vl-filename-directory Dcl_File))
(setq Dcl_File (strcat lujin "\\zdm彩色.dcl"))
(setq file (open Dcl_File "w"))
(write-line " text2:dialog{" file)
(write-line " label= \"zdm图层彩色\";" file)
(write-line " :edit_box{label=\"shuju\";key=\"ys-1\";edit_width=10;" file);图层及命令
(write-line " }" file)
(write-line " :edit_box{label=\"sjx \";key=\"ys-2\";edit_width=10;" file)
(write-line " }" file)
(write-line " :edit_box{label= \"标 尺\"; key= \"ys-3\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"网格1\"; key=\"ys-4\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"BPD1\"; key=\"ys-5\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"网格\"; key=\"ys-6\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"变坡点\"; key=\"ys-7\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"LCZH\"; key=\"ys-8\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"构造物\"; key=\"ys-9\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"图框\"; key=\"ys-10\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"超高中心\"; key=\"ys-11\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"页码\"; key=\"ys-12\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"栏目\"; key=\"ys-13\";edit_width=10;"file)
(write-line " }" file)
(write-line " :edit_box{label= \"pm\"; key=\"ys-14\";edit_width=10;"file)
(write-line " }" file)
(write-line " ok_cancel;" file)
(write-line " }" file)
(close file)
Dcl_File
)
最简单的用全局变量 黄翔 发表于 2024-7-16 15:49
最简单的用全局变量
已经5-6年没写了,忘得差不多了,哈哈,指导下? 這裡有範例請參考看看:
<***DCL面板設定+記憶功能+幻燈片(尺吋標註)***>
分享DCL面板設定+記憶功能+幻燈片 此面板設定擷取自 已發佈的 批量標註 Vˋ4.1版 程式
只有面板完整的操作+記憶功能 程式(不含 批量尺寸標注 lsp程式這部份)
用意: 了解DCL面板 記憶功能如何設定提供參考
TT2_CHS.RAR壓縮檔 內含 ( TT.LSP 及 SLD資料夾)
下載位置:
http://bbs.mjtd.com/thread-189122-1-1.html
系统注册表的读写
页:
[1]