工具箱面板,怎么调用插件位置
本帖最后由 pengl86 于 2021-8-22 16:08 编辑各位明经大佬您们好现在网上好多工具箱,怎么调用插件位置呢
工具箱面板上的命令,A.B.C.D
命令放D盘文件夹。
然后面板可以自动调用?????
如果收集的是源码 可以放在一起一次加载 如果不是都加载上 在面板中修改对应的命令就行 麻烦问一下,为什么你的截图里,按钮都是圆角的,但我加载你的插件,它显示出来的方角? 本帖最后由 xshrimp 于 2022-3-3 22:27 编辑
(setq #dcl_data
'( (0 "绘制");默认面板名称
(1 "射线");默认按钮
(2 3) ;按钮列数
("绘制"("画直线" "射线" "按钮11" "按钮12"))
("面板2" ("画圆" "射线" "按钮1""按钮2" "按钮3" "按钮4"))
("面板3" ("按钮a" "按钮b" "按钮c" "按钮d" "按钮e" "按钮f"))
)
)
;主程序(常用)
;;;xshrimp 2022.3.3 修改
(vl-load-com)
(defun c:qq ( / dcl_btn_col dcl_data_sel dcl_sel dcl_str dclid dlc_Default fn fname i key_act Loop n re times tmp x)
(if (null #dcl_cmdpos) (setq #dcl_cmdpos '(-1 -1)))
(setq Loop t)
(while Loop
(setq fname (vl-filename-mktemp nil nil ".dcl" ))
(setq fn (open fname "w" ))
(setq dcl_str (list
"agtckz : dialog{"
"label=\"CAD小秘书\";"
":boxed_radio_row {key = \"radio\" ;"
))
(foreach n (cdddr #dcl_data)
(setq dcl_str (append dcl_str (list (strcat ":radio_button {key = \"" (car n) "\" ;label =\"" (car n) "\" ;width=10;}"))))
)
(setq dcl_str (append dcl_str (list
" }"
" :row{")))
;;2列/////
(setq dcl_data_sel(cadr(assoc (cadr(assoc 0 #dcl_data)) #dcl_data)))
(setq i 0)
(setq dcl_btn_col (cadr(assoc 2 #dcl_data)))
(setq times (/ (length dcl_data_sel) dcl_btn_col))
(repeat dcl_btn_col
(setq dcl_str (append dcl_str (list
" :boxed_column{"
)))
(repeat times
(setq tmp (nth i dcl_data_sel))
(setq dcl_str (append dcl_str (list
(strcat " :button{key=\"" tmp"\";label=\"" tmp"\";width=10;}")
)))
(setq i (1+ i))
)
(setq dcl_str (append dcl_str (list
" }"
)))
)
;;;;;/////
(setq dcl_str (append dcl_str (list
" }"
"cancel_button;"
"}" )))
(foreach x dcl_str
(princ x fn)
(write-line "" fn)
);end foreach
(close fn)
(setq dclid (load_dialog fname))
(new_dialog "agtckz" dclid "" #dcl_cmdpos)
(setq dcl_sel (assoc 0 #dcl_data))
(set_tile "radio" (cadr dcl_sel))
;;;默认按钮
(setq dlc_Default (assoc 1 #dcl_data))
(mode_tile(cadr dlc_Default)2)
(foreach n(cdddr #dcl_data)
(action_tile (car n )(vl-prin1-to-string'(progn
(setq #dcl_data (subst (list 0 $key) (assoc 0 #dcl_data) #dcl_data))
(setq #dcl_cmdpos (done_dialog 2))
)))
)
(foreach n(setq dcl_data_sel(cadr(assoc (cadr(assoc 0 #dcl_data)) #dcl_data)))
(action_tile n(vl-prin1-to-string'(progn
(setq key_act $key)
(setq #dcl_data (subst (list 1 $key) (assoc 1 #dcl_data) #dcl_data))
(setq #dcl_cmdpos (done_dialog 3))
)))
)
(action_tile "cancel" "(setq #dcl_cmdpos (done_dialog 0))" )
(setq re (start_dialog))
(cond
((= re 0) (setq loop nil))
((= re 2) (vl-file-delete fname))
((= re 3)
(setq loop nil)
(cond
;;;这里添加命令
((= key_act "画直线") (command "line" pause))
((= key_act "画圆")(command "circle" pause))
((= key_act "射线")(command "ray" pause))
((= key_act "按钮1") (alert "按钮1"))
((= key_act "按钮11") (alert "按钮11"))
)
)
);end cond
);end while
(unload_dialog dclid)
(princ)
)
离迷你面板差不多了 xshrimp 发表于 2022-3-3 20:47
面板名称可以放在左侧面吗,那样可能要好些
优秀的作品 xshrimp 发表于 2022-3-3 20:47
感谢分享~
已经做成命令类工具面板~
还不错~ 感谢大佬的分享 fyy19950808 发表于 2022-3-2 15:57
麻烦问一下,为什么你的截图里,按钮都是圆角的,但我加载你的插件,它显示出来的方角?
电脑系统问题
页:
[1]