- 积分
- 14972
- 明经币
- 个
- 注册时间
- 2020-5-10
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2021-2-2 09:54:35
|
显示全部楼层
谢谢群主,回馈本帖,记忆这个是同一个命令下面IF函数用得过多造成的,我的解决方案是将IF函数拆分,就不会出现“在主页,进去其他菜单(如网页),,要点两次关闭才能关闭”这个问题了,,,伸手党本来想收一个币来着(折腾了几个小时才搞定的),好像系统出问题了,传不上来附件,,算了,!!!希望还有更简便的解决方案!!
(defun c:bb ()
(if (null bbdigopen) (setq bbdigopen -1))
(if (= bbdigopen -1) (bbdig0) (c:bb01))
(princ))
(defun c:bb01 ()
(if (= bbdigopen -2) (bbdig1) (c:bb02))
(princ))
(defun c:bb02 ()
(if (= bbdigopen -3) (bbdig2) (c:bb03))
(princ))
(defun c:bb03 ()
(if (= bbdigopen -4) (bbdig3) (c:bb04))
(princ))
(defun c:bb04 ()
(if (= bbdigopen -5) (bbdig4) (bbdig5))
(princ))
(defun bbdig0 ()
(setq bbdigopen -1)
(mai_make_panel
(list
(list "网页"
(list "批量打印" "aa1")
(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 ()
(setq bbdigopen -2)
(mai_make_panel
(list
(list "网页"
(list "批量打印" "aa1")
(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()
(setq bbdigopen -3)
(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 ()
(setq bbdigopen -4)
(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()
(setq bbdigopen -5)
(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()
(setq bbdigopen -6)
(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))))(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_nobut 0 in 0 num_image 0)
(foreach nn menulist(setq in 0)(add_dclrow (strcat " : column{label=\"" (car nn) "\";vertical_margin=none; horizontal_margin=none;"))
(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 ""))
(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 "cancel" "(done_dialog 0)")(action_tile "bbzydig" "(done_dialog -1)")(action_tile "bbwydig" "(done_dialog -2)")(action_tile "bbhtdig" "(done_dialog -3)")(action_tile "bbtkdig" "(done_dialog -4)")(action_tile "bbgjdig" "(done_dialog -5)")(action_tile "bbwenzidig" "(done_dialog -6)")(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 -1) (bbdig0))(if (= nn -2) (bbdig1))(if (= nn -3) (bbdig2))(if (= nn -4) (bbdig3))(if (= nn -5)(bbdig4))(if (= nn -6)(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)))))
|
评分
-
查看全部评分
|