[求助] 自定义vlx面板。
假设我有两个插件“aaa.vlx”(命令aaa),“bbb.vlx”(命令bb1、bb2)。使用时候,共有三个命令,aaa、bb1、 bb2。
在不改变原有插件的条件下,能不能通过代码执行一个命令“abc”,出现一个自定义面板,
上面有自己定义文字的“按键”,点击后执行原有各自的功能。
分享一下你的面板源码吗 论坛找个自定义面板,研究下怎么用!我试过了!能实现! 用老迈的面板函数,这个要求太容易了 分享一下面板源码:handshake{:1_1:} foer123 发表于 2020-1-14 16:54
分享一下面板源码
我没有源码,那是“贱人工具箱”中“我的贱人”的界面,截图下来做个示意。:lol:lol 这个不难啊,论坛里有就LISP的自定义面板!(vl-load-com)
(defun c:vf (/ fname fn x dclid lin)
(setq fname (vl-filename-mktemp nil nil ".dcl" ))
(setq fn (open fname "w" ))
(foreach x '(
"agtckz : dialog{"
"label=\"附加绘图工具\";"
":radio_column {"
":row {"
":radio_button {key = \"91\" ;label =\"常用\" ;value = "1";width=10;mnemonic = "q";}"
":radio_button {key = \"92\" ;label =\"专用\" ;width=10;}"
":radio_button {key = \"93\" ;label =\"其他\" ;width=10;}"
" }"
" }"
" :row{"
" :boxed_column{"
" label=\"常用\";"
" :row{"
" :button{key=\"1\";label=\"立面门1\";width=10;mnemonic ="o";}"
" :button{key=\"2\";label=\"立面门2\";width=10;}"
" :button{key=\"3\";label=\"立面门3\";width=10;}"
" :button{key=\"4\";label=\"立面门3\";width=10;}"
" }"
" :row{"
" :button{key=\"5\";label=\"立面门3\";width=10;}"
" :button{key=\"6\";label=\"立面门4\";width=10;}"
" :button{key=\"7\";label=\"立面门3\";width=10;}"
" :button{key=\"8\";label=\"立面门3\";width=10;}"
" }"
" :row{"
" :button{key=\"9\";label=\"天花1\";width=10;}"
" :button{key=\"10\";label=\"天花2\";width=10;}"
" :button{key=\"11\";label=\"天花2\";width=10;}"
" :button{key=\"12\";label=\"立面门3\";width=10;}"
" }"
" :row{"
" :button{key=\"13\";label=\"天花3\";width=10;}"
" :button{key=\"14\";label=\"天花4\";width=10;}"
" :button{key=\"15\";label=\"天花2\";width=10;}"
" :button{key=\"16\";label=\"立面门3\";width=10;}"
" }"
" }"
" }"
" :row{"
" :button{key=\"94\";label=\"返回主工具\";width=10;}"
":button{label="退出"; key ="cancel";is_cancel = true;}"
" }"
"}"
);end ;endlist
(princ x fn)
(write-line "" fn)
);end foreach
(close fn)
(setq fn (open fname "r" ))
(setq dclid (load_dialog fname))
(while (or (eq (substr (setq lin (vl-string-right-trim "\" fn)" (vl-string-left-trim "(write-line \"" (read-line fn)))) 1 2) "//" ) (eq (substr lin 1 (vl-string-search " " lin)) "" ) (not (eq (substr lin (+ (vl-string-search " " lin) 1) 9) " : dialog" ))))
(new_dialog (substr lin 1 (vl-string-search " " lin)) dclid)
(action_tile "1" "(done_dialog 1)" )
(action_tile "2" "(done_dialog 2)" )
(action_tile "3" "(done_dialog 3)" )
(action_tile "4" "(done_dialog 4)" )
(action_tile "5" "(done_dialog 5)" )
(action_tile "6" "(done_dialog 6)" )
(action_tile "7" "(done_dialog 7)" )
(action_tile "8" "(done_dialog 8)" )
(action_tile "9" "(done_dialog 9)" )
(action_tile "10" "(done_dialog 10)" )
(action_tile "11" "(done_dialog 11)" )
(action_tile "12" "(done_dialog 12)" )
(action_tile "13" "(done_dialog 12)" )
(action_tile "14" "(done_dialog 12)" )
(action_tile "15" "(done_dialog 12)" )
(action_tile "16" "(done_dialog 12)" )
(action_tile "91" "(done_dialog 91)" )
(action_tile "92" "(done_dialog 92)" )
(action_tile "93" "(done_dialog 93)" )
(action_tile "94" "(done_dialog 94)" )
(action_tile "cancel" "(done_dialog 0)" )
(setq re (start_dialog))
(cond
((= re 1) (C:KM))
((= re 2) (GL:2))
((= re 3) (GL:3))
((= re 4) (GL:4))
((= re 5) (C:TH1))
((= re 6) (C:TH2))
((= re 7) (C:TH3))
((= re 8) (GL:8))
((= re 9) (GL:8))
((= re 10) (GL:8))
((= re 11) (GL:8))
((= re 12) (GL:8))
((= re 13) (GL:8))
((= re 14) (GL:8))
((= re 15) (GL:8))
((= re 16) (GL:8))
((= re 91) (c:vf))
((= re 92) (c:yx_zy))
((= re 93) (c:yx_qt))
((= re 94) (C:vv))
);end cond
(unload_dialog dclid)
(close fn)
(vl-file-delete fname)
(princ)
)
没有问题,可以实现。 首先写面板即可
页:
[1]