svorgodne 发表于 2022-7-6 09:33:35

dcl函数imag中的命令

我想知道是否可以在dcl文件中调用命令,如果可以的话。。。它必须通过lisp文件调用吗?
再次感谢
塞尔吉奥

JohnM 发表于 2022-7-6 09:57:55

是的,如果您将dcl设置为循环以供用户输入,则可以
你能把你的dcl文件寄出去吗

svorgodne 发表于 2022-7-6 10:22:23

给你,谢谢
 
UNO : dialog {
label = "Primera ventana";//Titulo de la ventana
spacer;//espacio entre renglones
   : row {
   alignment = centered;
   fixed_width = true;
   : image_button {
   key = "LINE";
   width = 20;
   height = 10;
   color = -2;
   }
   : image_button {
   key = "";
   width = 20;
   height = 10;
   color = -2;
   }
   : image_button {
   key = "";
   width = 20;
   height = 10;
   color = -2;
   }
   : image_button {
   key = "";
   width = 20;
   height = 10;
   color = -2;
   }
   : image_button {
   key = "";
   width = 20;
   height = 10;
   color = -2;
   }
}
   : row {
   fixed_width = true;
   alignment = left;
   : ok_button {
   width = 11;
   }
   : cancel_button {
   width = 11;
   }
}
}

JohnM 发表于 2022-7-6 10:45:59

循环是在调用dcl对话框的lisp中创建的
下面的示例中是我的一个调用Lisp
查看lisp的结构
查看并遵循what_next循环
在这种情况下,当用户单击对话框上的按钮时,将调用以下动作互动程序(action\u tile“qdx\u wld”“(done\u dialog 4)”)
done\u对话框4然后调用底部代码的cond部分,然后调用my命令。
(条件
(=what_next 4)
(命令“ucs”“world”))
 

(defun qdx:DialogInput (/ dcl_id       dialogloaded dialogshow
                         dr_file      dr_set       qdx_depth
                         qdx_hwos   qdx_matt   qdx_sing
                         result       userclick    what_next
                     )
(setq dialogLoaded T
dialogShow T)
(if (= -1 (setq dcl_id (load_dialog "qdx.DCL")))
(progn
(princ "\nERROR: Cannot load qdx.dcl")
(setq dialogLoaded nil)
) ;_ end of progn
) ;_ end of if
(setq what_next 2)
(while (>= what_next 2)
(if (and (not (new_dialog "qdx_maindlg" dcl_id))
dialogLoaded
) ;_ end of and
(progn
(princ "\nERROR: Cannot show dialog qdxdlg")
(setq dialogShow nil)
) ;_ end of progn
) ;_ end of if
(if (and dialogLoaded dialogShow)
(progn
       (setq qdxff (findfile "c:/program files/quick draw/qdxlu.jdb"))
       (if qdxff
       (progn
(setq dr_file (open qdxff "r"))
(setq retval (read(read-line dr_file)))
(close dr_file)
       (set_tile "qdx_hwo" (cdr(assoc 2 retval)));_hardware offset
(set_tile "qdx_mtk" (cdr(assoc 1 retval)));_material thick
       (if (= (cdr(assoc 3 retval)) "1")
       (progn
(set_tile "qdx_sin" "1");_single
       (set_tile "qdx_dbl" "0");_double
       );_progn
       (progn
(set_tile "qdx_sin" "0");_single
       (set_tile "qdx_dbl" "1");_double
       );_progn
       );_if
(set_tile "qdx_dpt" (cdr(assoc 4 retval)));_depth
(mode_tile "qdx_dpt" 2)
       );_progn
       (progn
(set_tile "qdx_hwo" "0.5313");_hardware offset
(set_tile "qdx_mtk" "0.75");_material thick
(set_tile "qdx_sin" "1");_single
       (set_tile "qdx_dbl" "0");_double
(set_tile "qdx_dpt" "20.00");_depth
       (mode_tile "qdx_dpt" 2)
       );_progn
       );_if

       (action_tile "qdx_sin" "(set_tile \"qdx_dbl\" \"0\")")
(action_tile "qdx_dbl" "(set_tile \"qdx_sin\" \"0\")")
(action_tile "qdx_wld" "(done_dialog 4)")
(action_tile "qdx_obj" "(done_dialog 5)")
(action_tile "qdxhlp""(help \"QD50.HLP\" \"Topic13\")")
(action_tile "cancel" "(done_dialog)(setq UserClick nil) ")
(action_tile
"accept"
(strcat
"(progn"
"(setq qdx_sing (get_tile \"qdx_sin\"))"
"(setq qdx_depth (get_tile \"qdx_dpt\"))"
"(setq qdx_matt (get_tile \"qdx_mtk\"))"
"(setq qdx_hwos (get_tile \"qdx_hwo\"))"
"(if (> (atof(get_tile \"qdx_dpt\")) 0.00)(progn (done_dialog)(setq UserClick T))"
"(alert \" Enter a box depth.\")))"
) ;_end strcat
) ;_ end of action_tile
(setq what_next (start_dialog))
(if UserClick   ; User clicked Ok
;; Build the resulting data
(progn
(setq result
       (list
(cons 3 qdx_sing);single or double
(cons 4 qdx_depth);_depth
(cons 1 qdx_matt);_material thickness
(cons 2 qdx_hwos);_hardware offset
) ;_ end of list
);_setq
       (qdx_wt_fl (vl-prin1-to-string result));_write last used to file
);_progn
) ;_ end of if
) ;_ end of progn
) ;_ end of if
(cond
((= what_next 4)
(command "ucs" "world"))
((= what_next 5)
(qdx_obsel))      
);_end cond
);_end while
(unload_dialog dcl_id)
result
) ;_ end of defun

页: [1]
查看完整版本: dcl函数imag中的命令