好的,看看这是不是你想要的。
YNC。DCL
- // ync.dcl
- // Dialog box for yes, no, cancel options to be referenced from AutoLISP
- //
- ync: dialog {
- label = "Save Drawing?";
- : text_part {
- label = "Drawing will be saved to AutoCAD Mechanical 2006 or AutoCAD 2004 depending on profile used... ";
- }
- : row {
- : button { label = "&Yes"; key = "Yes"; is_Yes = true; }
- : button { label = "&No"; key = "No"; is_No = true; }
- : button { label = "&Exit"; key = "cancel"; is_cancel = true; }
- }
- }
YNC。lsp
- (defun c:YNC (/ dcl_ync_id)
- (setq dcl_ync_id (load_dialog "ync.dcl"))
- (if (not (new_dialog "ync" dcl_ync_id))
- (exit))
- (action_tile "Yes" "(Yes)(done_dialog)")
- (action_tile "No" "(No) (done_dialog) ")
- (action_tile "cancel" "(done_dialog)")
- (start_dialog)
- (unload_dialog dcl_ync_id)
- (princ)
- )
- (defun Yes ()
- (princ "You selected Yes.")
- (princ)
- )
- (defun No ()
- (princ "You selected No.")
- (princ)
- )
当然,您仍然需要提供自己的编码。 |