1028695446
发表于 2019-4-14 22:23:36
本帖最后由 1028695446 于 2019-5-28 00:21 编辑
带命令提示
1291500406
发表于 2019-4-14 22:27:12
1028695446 发表于 2019-4-14 22:23
;(list "按键提示" "执行命令" "提供命令的文件名" "命令缩写" "分割线颜色")
大界面,找按钮找半天
1291500406
发表于 2019-5-15 22:25:16
1025143880 发表于 2019-5-15 21:40
刷积分测点分发额分发
what are you 弄啥嘞?
guobao1985
发表于 2019-5-16 07:27:08
这界面看起来和键盘差不多~
slq803
发表于 2019-5-20 13:29:27
谢谢楼主分享
王航
发表于 2019-5-20 13:59:01
想法不错!
szmaicy
发表于 2019-5-20 22:19:36
多年前的帖子,好像现在用这个的修改版才全面爆发
1028695446
发表于 2019-5-28 00:19:45
本帖最后由 1028695446 于 2019-5-28 00:23 编辑
C:\Users\090955\Desktop\QQ截图20190528001814.png
(defun c:bb () (bbdig0) (princ))
(defun bbdig0 ()
(mai_make_panel
(list
(list "网页"
(list "批量打印" "aa1") ;(list按钮标签运行的命令)
(list "统计设置" "aa2")
(list "统计长度" "aa3")
(list "面积统计" "AT")
(list "系统算器" "aa4")
(list "查vlxkey" "aa5")
(list "地址收藏" "aa6")
(list "花堂文学" "aa7")
(list "爱图论坛" "aa8")
(list "Itellyou" "aa9")
) ;_ 结束list
(list "绘图"
(list "管道截面" "gdjm")
(list "管道截断" "gdjd")
(list "绘制螺栓" "sd")
(list "绘制螺丝" "bls")
(list "螺栓连接" "aa10")
(list "绘制管道" "aa11")
(list "上下弯头" "aa12")
(list "表格 C2E" "aa13")
(list "字上下标" "zsxb")
(list "日期日历" "Calendar")
) ;_ 结束list
(list "图块"
(list "查找图块" "Count")
(list "查块连线" "bb2")
(list "图块替换" "bb3")
(list "圆心插块" "bb4")
(list "图块编号" "PEACE-BN")
(list "递增复制" "xcc")
(list "X to cad" "x2c")
(list "转ACAD表" "cot")
(list "表格导出" "te")
(list "文本导出" "wr")
) ;_ 结束list
(list "工具"
(list "递增刷子" "dz")
(list "相同刷子" "xts")
(list "做中心线" "ce")
(list "表格居中" "tabm")
(list "字居中①" "cc1")
(list "字居中②" "cc2")
(list "引线标注" "cc5")
(list "增减数字" "cc6")
(list "局部放大" "fd")
(list "自助修剪" "trxx")
) ;_ 结束list
(list "文字"
(list "文本加圆" "dd1")
(list "加下划线" "jbtx")
(list "字定位①" "czdw1")
(list "字定位②" "czdw2")
(list "拆分文字" "exstr")
(list "合并文字" "dd5")
(list "字对齐①" "wzqx")
(list "字对齐②" "dd7")
(list "文字加框" "wzbk")
(list "加圈递增" "NumInc")
) ;_ 结束list
) ;_ 结束list
) ;_ 结束mai_mak_panel
(princ)
)
(defun bbdig1 ()
(mai_make_panel
(list
(list "网页"
(list "批量打印" "aa1") ;(list按钮标签运行的命令)
(list "统计设置" "aa2")
(list "统计长度" "aa3")
(list "面积统计" "AT")
(list "系统算器" "aa4")
(list "查vlxkey" "aa5")
(list "地址收藏" "aa6")
(list "花堂文学" "aa7")
(list "爱图论坛" "aa8")
(list "Itellyou" "aa9")
) ;_ 结束list
) ;_ 结束list
) ;_ 结束mai_mak_panel
(princ)
)
(defun bbdig2 ()
(mai_make_panel
(list
(list "绘图"
(list "管道截面" "gdjm")
(list "管道截断" "gdjd")
(list "绘制螺栓" "sd")
(list "绘制螺丝" "bls")
(list "螺栓连接" "aa10")
(list "绘制管道" "aa11")
(list "上下弯头" "aa12")
(list "表格 C2E" "aa13")
(list "字上下标" "zsxb")
(list "日期日历" "Calendar")
) ;_ 结束list
) ;_ 结束list
) ;_ 结束mai_mak_panel
(princ)
)
(defun bbdig3 ()
(mai_make_panel
(list
(list "图块"
(list "查找图块" "Count")
(list "查块连线" "bb2")
(list "图块替换" "bb3")
(list "圆心插块" "bb4")
(list "图块编号" "PEACE-BN")
(list "递增复制" "xcc")
(list "X to cad" "x2c")
(list "转ACAD表" "cot")
(list "表格导出" "te")
(list "文本导出" "wr")
) ;_ 结束list
) ;_ 结束list
) ;_ 结束mai_mak_panel
(princ)
)
(defun bbdig4 ()
(mai_make_panel
(list
(list "工具"
(list "递增刷子" "dz")
(list "相同刷子" "xts")
(list "做中心线" "ce")
(list "表格居中" "tabm")
(list "字居中①" "cc1")
(list "字居中②" "cc2")
(list "引线标注" "cc5")
(list "增减数字" "cc6")
(list "局部放大" "fd")
(list "自助修剪" "trxx")
) ;_ 结束list
) ;_ 结束list
) ;_ 结束mai_mak_panel
(princ)
)
(defun bbdig5 ()
(mai_make_panel
(list
(list "文字"
(list "文本加圆" "dd1")
(list "加下划线" "jbtx")
(list "字定位①" "czdw1")
(list "字定位②" "czdw2")
(list "拆分文字" "exstr")
(list "合并文字" "dd5")
(list "字对齐①" "wzqx")
(list "字对齐②" "dd7")
(list "文字加框" "wzbk")
(list "加圈递增" "NumInc")
) ;_ 结束list
) ;_ 结束list
) ;_ 结束mai_mak_panel
(princ)
)
(defun c:bbdig6 ()
(alert "问君能有几多愁,恰似一江春水向东流")
(princ)
)
(defun mai_make_panel (menulist / n num_nobut
num_button nn nnn menuname
val_lst add_dclrow tt order_lst
in num_image
)
(defun add_dclrow (dstr /)
(if dstr
(setq val_lst (cons dstr val_lst))
)
)
(defun LM:PadBetween ( s1 s2 ch ln )
(if (< (+ (strlen s1) (strlen s2)) ln)
(LM:PadBetween (strcat s1 ch) s2 ch ln)
(strcat s1 s2)
)
)
(setq menuname (strcat (vl-filename-mktemp) "temp_pannel.dcl"))
(add_dclrow
"curbutton:button{width=10;vertical_margin=none;vertical_margin=none;}"
)
(add_dclrow
"curimage:image{width=10;height=0.2;vertical_margin=none;vertical_margin=none;}"
)
(add_dclrow
"curpanel:dialog{key=\"bbtimexx\";alignment=centered;vertical_margin=none;horizontal_margin=none;"
)
(add_dclrow ":row{")
(setq len (apply 'max (mapcar 'length menulist))
order_lst(apply 'append (mapcar 'cdr menulist))
num_button 0
num_nobut0
in 0
num_image0
)
(foreach nn menulist
(setq in 0)
(add_dclrow
(strcat " : column{label=\""
(car nn)
"\";vertical_margin=none; horizontal_margin=none;"
)
)
(foreach nnn (cdr nn)
(setq tt (car nnn));三级列表,文字提示
(setq tt (if tt tt ""))
(setq tt-ml (cadr nnn));;获取命令***注意表中位置,第2个元素)
(setq tt-ml (if tt-ml tt-ml ""))
(setq str-n (strlen (strcat tt "" tt-ml)))
(setq str-n-lst (cons str-n str-n-lst))
);;;控制 String1..String2
(setq str-n-max(apply 'max str-n-lst))
(foreach nnn (cdr nn)
(setq num_button (1+ num_button);二级列表,按钮编号
in (1+ in)
num_image (1+ num_image)
tt (car nnn);三级列表,文字提示
tt (if tt tt "")
)
(if (and(setq tt-ml (cadr nnn));;获取命令***注意表中位置,第2个元素)
(/= tt-ml "")
(/= tt "")
)
(setq tt (LM:PadBetween tt tt-ml "." str-n-max))
)
(add_dclrow
(strcat
":curbutton{label=\""
tt
"\";horizontal_margin = none;vertical_margin = none;key=\"but"
(itoa num_button)
"\";}"
)
)
(if (= 30 in)
(progn (add_dclrow
(strcat ":curimage{key=\"ima"
(itoa num_image)
"\";color=18;}"
)
)
(setq in 0)
)
)
)
(repeat (- len (length nn))
(setq num_nobut (1+ num_nobut)
in (1+ in)
num_image (1+ num_image)
)
(add_dclrow
(strcat " : curbutton{key=\"butno"
(itoa num_nobut)
"\";color=-2;}"
)
)
(if (= 10 in)
(progn (add_dclrow
(strcat ":curimage{key=\"ima" (itoa num_image) "\";}")
)
(setq in 0)
)
)
)
(add_dclrow "spacer;}")
)
(add_dclrow
"} :row{:button{label =\"主页\" ; key=\"bbzydig\" ; horizontal_margin = none;vertical_margin = none;} :button{label =\"网页\" ; key=\"bbwydig\" ; horizontal_margin = none;vertical_margin = none;} :button{label =\"绘图\" ; key=\"bbhtdig\" ; horizontal_margin = none;vertical_margin = none;}:button{label =\"图块\" ; key=\"bbtkdig\" ;horizontal_margin = none;vertical_margin = none; } :button{label =\"工具\" ; key=\"bbgjdig\" ; horizontal_margin = none;vertical_margin = none;} :button{label =\"文字\" ; key=\"bbwenzidig\" ;horizontal_margin = none;vertical_margin = none; }:button{label =\"关闭\" ; key=\"cancel\" ; is_cancel = true;horizontal_margin = none;vertical_margin = none;}:button{label =\"关于\" ; key=\"findhelp\" ; horizontal_margin = none;vertical_margin = none;}}}"
)
(vl-file-delete menuname)
(setq nn (open menuname "w"))
(foreach n (reverse val_lst) (write-line n nn))
(close nn)
(setq nnn (load_dialog menuname))
(if (not (new_dialog "curpanel" nnn))
(exit)
)
(set_tile
"bbtimexx"
(strcat
(menucmd
"M=$(edtime,$(getvar,date), 迷你工具箱 必强提示现在时间是:YYYY/MO/DD DDDD HH:MM )"
)
)
)
(action_tile "bbzydig" "(done_dialog -29999)")
(action_tile "bbwydig" "(done_dialog -30000)")
(action_tile "bbhtdig" "(done_dialog -30001)")
(action_tile "bbtkdig" "(done_dialog -30002)")
(action_tile "bbgjdig" "(done_dialog -30003)")
(action_tile "bbwenzidig" "(done_dialog -30004)")
(action_tile "findhelp" "(c:bbdig6)")
(setq n 0)
(repeat num_nobut
(mode_tile (strcat "butno" (itoa num_nobut)) 1)
(setq num_nobut (1- num_nobut))
)
(foreach nn menulist
(foreach nnn (cdr nn)
(setq n(1+ n)
tt (car nnn)
tt (if tt
tt
""
)
tt order_lst
)
(if (= tt "")
(mode_tile (strcat "but" (itoa n)) 1)
(action_tile
(strcat "but" (itoa n))
(strcat "\(done_dialog " (itoa n) "\)")
)
)
)
)
(setq nn (start_dialog))
(unload_dialog nnn)
(vl-file-delete menuname)
(if (= nn -29999)
(bbdig0)
)
(if (= nn -30000)
(bbdig1)
)
(if (= nn -30001)
(bbdig2)
)
(if (= nn -30002)
(bbdig3)
)
(if (= nn -30003)
(bbdig4)
)
(if (= nn -30004)
(bbdig5)
)
(if (> nn 0)
(progn (setq tt (cadr (nth (1- nn) order_lst)))
(princ "\n")
(if (= (eval (read (strcat "(type c:" tt ")"))) 'SUBR)
(eval (read (strcat "(c:" tt ")")))
(vl-cmdf tt)
)
)
)
)
依然小小鸟
发表于 2019-5-28 09:12:10
1028695446 发表于 2019-5-28 00:19
(defun c:bb () (bbdig0) (princ))
(defun bbdig0 ()
(mai_make_panel
省略线变成分界线好一些
tangjunasd58
发表于 2019-6-2 23:45:23
;;这个也能优化成带记忆那版那样的不 titl:标题; buttons:按钮列表; flag:nil先行后列T先列后行(defun Dcl-ButtonM (titl buttons flag / a b c)(defun strsplist (str / i) (if (setq i (vl-string-search " " str)) (list (substr str 1 i) (vl-string-trim " " (substr str (+ 2 i))) ) ))(defun makedcl (str_lst / fileID dclHandle) (setq dclfile (vl-filename-mktemp nil nil ".dcl") fileID(open dclfile "w") ) (cond ((= (type str_lst) 'str) (write-line str_lst fileID)) ((= (type str_lst) 'list) (foreach n str_lst (write-line n fileID)) ) ) (close fileID) (setq dclHandle (load_dialog dclfile)))(setq b (if flag ":column{ label = \"" ":row{children_alignment = top ;\n children_fixed_height = true ;\n label = \"" ) c (if flag ":row{children_alignment = top ;\n children_fixed_height = true ;\nlabel = \"" ":column{label = \"" ) d '("ESC") a (strcat (vl-string-translate "$~" "AB" (vl-filename-base (vl-filename-mktemp)) ) ":dialog{label=\"" titl "\";\n" b "\";\n" ))(foreach x buttons (if (listp x) (progn (setq a (strcat a c (car x) "\";\n")) (foreach y (last x) (setq b (strsplist y) a (if b (strcat a ":button {key =\"" (car b) "\";label=\"" (last b) "\";}\n" ) (strcat a "spacer_0;\n") ) d (if (/= (car b) nil) (cons (car b) d) d ) ) ) (setq a (strcat a "}\n")) ) (setq a (strcat a "spacer_0;\n")) ))(setq d (cdr (REVERSE d)) a (strcat a (if flag "} spacer_1;:row" "} spacer_1;:row" );;; "{spacer_0;:button{key = \"HLP\";label = \"帮助\";}\n";;; ":button{key=\"ESC\";label=\"取消\";is_cancel = true;}}}";;; "{alignment = centered ;\n fixed_width = true ; \n spacer_0;\n cancel_button; \n;;; :text{fixed_width = true ; \n width = 2;\n } \n help_button;}}" "{alignment = centered ; \n fixed_width = true ;\n help_button; \n :text{fixed_width = true ; \n width = 2;\n } \n cancel_button;}}" ) dcl(makedcl a) lst1 '() i 1)(foreach key d (setq tx (strcat "(action_tile \"" key "\"\"(done_dialog " (itoa i) ")\")" ) lst1 (cons tx lst1) i (1+ i) ))(new_dialog (substr a 1 8) dcl);(action_tile "ESC" "(done_dialog 0)")(action_tile "cancel" "(done_dialog 0)");(action_tile "HLP" "(alert\"通用了,还郁闷?\")")(action_tile "help" "(alert\"通用了,还郁闷?\")")(eval (read (strcat "(progn" (apply 'strcat lst1) ")")))(setq ctl (start_dialog))(UNLOAD_DIALOG dcl)(vl-file-delete dclfile)(if (/= ctl 0) (progn (setq cmds(nth (- ctl 1) d)) (cond ((or(= (eval (read (strcat "(type c:" cmds ")"))) 'SUBR) (= (eval (read (strcat "(type c:" cmds ")"))) 'USUBR)) (princ "\n") (eval (read (strcat "(c:" cmds ")")))) ((or(= (eval (read (strcat "(type " cmds ")"))) 'SUBR) (= (eval (read (strcat "(type " cmds ")"))) 'USUBR)) (princ "\n") (eval (read (strcat "(" cmds ")")))) (t (princ "\n")(vl-load-com)(vl-cmdf cmds)) ) ) ))(defun c:tt (/ lst)(setq lst '(("钢筋、书写" ("xyp-gjg 钢筋结钩(&G) " "lljx 另类镜像(&L) " "" "bjcl 板筋处理(&!) " "dtbj 动态板筋 ") ) ("注筋、标注" ("zjpb 注筋排版(&1) " "zjzz 注筋左置 " "" "zjyw 注筋移位 " "gtcm 改图层名 ") ) ("桩基网架" ("zjct 桩基承台 " "zjtj 桩基统计 " "" "pbwj 平板网架 " "qxhj 曲线桁架 ") ) ("编辑处理" ("glbh 改粱编号 " "lkjd 梁宽校对 " "" "lzxj 梁柱修剪 " "xyp-jzl 井字梁 " "tt2 切换(&C) " "tt22 TT ") ) ))(Dcl-ButtonM "【XX工具】V2014.1.21" lst t)(princ))(defun c:tt2 (/ lst)(setq lst '(("钢筋、书写" ("xyp-gjg 钢筋结钩 " "lljx 另类镜像 " "" "bjcl 板筋处理 " "dtbj 动态板筋 ") ) ("注筋、标注" ("zjpb 注筋排版 " "zjzz 注筋左置 " "" "zjyw 注筋移位 " "gtcm 改图层名 ") ) ("桩基网架" ("zjct 桩基承台 " "zjtj 桩基统计 " "" "pbwj 平板网架 " "qxhj 曲线桁架 " "line 直线") ) ("编辑处理" ("glbh 改粱编号 " "lkjd 梁宽校对 " "" "lzxj 梁柱修剪 " "xyp-jzl 井字梁 ""tt3 切换(&C) ") ) ))(Dcl-ButtonM "呵呵,我是第二窗口哦" lst nil)(princ))(defun tt3 (/ lst)(setq lst '(("钢筋、书写" ("xyp-gjg 钢筋结钩 " "lljx 另类镜像 " "" "bjcl 板筋处理 " "dtbj 动态板筋 ") ) ("注筋、标注" ("zjpb 注筋排版 " "zjzz 注筋左置 " "" "zjyw 注筋移位 " "gtcm 改图层名 ") ) ("桩基网架" ("zjct 桩基承台 " "zjtj 桩基统计 " "" "pbwj 平板网架 " "qxhj 曲线桁架 ") ) ("编辑处理" ("glbh 改粱编号 " "lkjd 梁宽校对 " "" "lzxj 梁柱修剪 " "xyp-jzl 井字梁 " "tt 切换(&C) ") ) ))(Dcl-ButtonM "哈哈,我是第三个窗口哦" lst nil)(princ))