面板源码
无聊没事发着玩,也是修改xshrimp的,不要喷我 1291500406 发表于 2019-4-23 18:10把一个数字改掉151改成1~255之间的数
大佬,这个面板源码能奉献下不 (setq lst '(("钢筋书写"
("钢筋结钩" "xyp-gjg")
("另类镜像" "lljx")
("板筋处理" "bjcl ")
("动态板筋" "dtbj")
)
("注筋标注"
("注筋排版" "zjpb")
("注筋左置 " "zjzz")
("注筋移位 " "zjyw")
("改图层名 " "gtcm")
)
("桩基网架"
("桩基承台 " "zjct")
("桩基统计 " "zjtj")
("平板网架 " "pbwj")
("曲线桁架 " "qxhj")
)
("编辑处理"
("改粱编号" "glbh")
("梁宽校对" "lkjd")
("梁柱修剪" "lzxj")
("井字梁 " "xyp-jzl")
)
)
)
;;(dcl-load lst)
(defun dcl-load (lst / make-dcl do_buttion
dclid dd i loop lst1 lst2
m n2 tt
)
(defun do_buttion (tt)
(if (= (eval (read (strcat "(type c:" tt ")"))) 'subr)
(eval (read (strcat "(c:" tt ")")))
(vl-cmdf tt)
)
)
(setq lst1 (mapcar 'car lst))
(defun make-dcl (lst / dcla dclb dclc dcld i lst2 m)
(setq dcla
(list "my_dialog:dialog{label = \"防迷你菜单\";")
)
(setq i 0)
(setq dclb (list ":row{:boxed_column{label = \"【菜单分组】\";"))
(foreach n lst1
(setq dclb
(append
dclb
(list
(strcat
":button{label=\""
n
"\";key = \"butt"
(itoa i)
"\";vertical_margin=none;vertical_margin=none;}"
)
)
)
)
(setq i (1+ i))
)
(setq lst2 (cdr (assoc (nth 0 lst1) lst)))
(setq dclc (list "}:boxed_column{"))
(setq m 0)
(foreach n1 lst2
(setq dclc
(append
dclc
(list
(strcat
":button{label=\""
(car n1)
"\";key = \"but"
(itoa m)
"\";vertical_margin=none;vertical_margin=none;}"
)
)
)
)
(setq m (1+ m))
)
(setq dcld
(list
"}}:button{label=\"关闭\";key=\"cancel\";is_cancel=true;width=10;fixed_width=true;alignment=centered;}}"
)
)
(append dcla dclb dclc dcld)
)
(new_dialog
"my_dialog"
(setq dclid (dcl-write (make-dcl lst)))
)
(setq loop t)
(while loop
;|
(setq i 0)
(repeat (length lst1)
(action_tile
(strcat "butt" (itoa i))
(progn (setq lst2 (cdr (assoc (nth i lst1) lst))
m 0
)
(foreach n2 lst2
(set_tile (strcat "but" (itoa m)) (car n2))
(action_tile
(strcat "but" (itoa m))
(progn
(setq tt (cadr (nth m lst2)))
(do_buttion tt)
)
)
(setq m (1+ m))
)
)
)
(setq i (1+ i))
)|;
(setq dd (start_dialog))
(cond
((= 0 dd) (setq Loop nil))
)
)
(unload_dialog dclid)
)
(defun dcl-write (lst / dcl_file file str dcl_id dcl-name)
(setq dcl_file (vl-filename-mktemp nil nil ".dcl"))
(setq file (open dcl_file "w"))
(foreach str lst (write-line str file))
(close file)
(setq dcl_id (load_dialog dcl_file))
(vl-file-delete dcl_file)
dcl_id
)
没法完成了,看下 本帖最后由 fangmin723 于 2017-8-25 17:33 编辑
独沐秋枫 发表于 2017-8-25 11:59
请问如何往里添加工具?
(defun c:drawline(/ p0) (command "LINE" (setq p0 (getpoint "\n指定第一个点:")) (getpoint p0 "\n指定第二个点:") ""))
把这句先加载到CAD里面去,然后再改(action_tile "1lab" "(alert \" 按了1lab\")")这句为(action_tile "1lab" "(done_dialog 2)"),改(cond
((= 0 dd) (setq Loop nil))
((= 2 dd) (setq Loop nil) (c:drawline))
)
然后加载tabs1.lsp文件,输ta1运行程序,选择工具一,点击名为1lab按钮试试!
fangmin723 发表于 2017-8-25 08:14
本帖最后由 fangmin723 于 2017-8-25 08:51 编辑
谢谢楼主的分享,两个文件一起用还是觉得太麻烦了,请原 ...
随便整,我发源码也没收钱目的就是让你们随便整:lol 看到的第一眼感觉怎么那么像迷你的面板 本帖最后由 fangmin723 于 2017-8-25 11:43 编辑
谢谢楼主的分享,两个文件一起用还是觉得太麻烦了,请原谅我把两个文件整合了,
如果有违楼主个人意愿,请通知删除!
注意:这个-From:dcl->lsp V1.8.6(beta)是用工具转化后自动生成的,如果不需要,可以在源代码里面进行去除!
楼主给的代码里面不含这个!
感谢楼主分享 谢谢!!!!!!! 我就喜欢这个 hao3ren 发表于 2017-8-25 10:43
随便整,我发源码也没收钱目的就是让你们随便整
请问如何往里添加工具? 如果是无模式对话框,那就完美了