The Buzzard 发表于 2022-7-6 11:03:58

 
我不知道你为什么这么做,但那是你的选择。您所需要做的就是添加“是”或“否”的条件编码,以及它在其余代码中的作用。
 
dcl现在出现了,所以我想你可以从这里开始。如果你卡住了,请再打电话。

The Buzzard 发表于 2022-7-6 11:08:38

 
试试这个。
 

(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"    "(setq cmd ($key))(done_dialog)" )
(action_tile "No"   "(setq cmd ($key))(done_dialog)" )
(action_tile "Cancel" "(setq cmd ($key))(done_dialog)" )
(start_dialog)
(unload_dialog dcl_ync_id)
(command cmd)
)

The Buzzard 发表于 2022-7-6 11:13:35

在这一点上,你只能靠自己。
我是在帮助DCL,而不是代码应该做什么。
 
也许现在可以用一个新主题重新发布到一个新的线程。

sanderson 发表于 2022-7-6 11:13:55

好的,这是新的独家新闻。我现在使用的不是格式错误的列表,而是糟糕的函数。另外,我如何传回或调用它,以便使用返回的值?这应该可以做到,再次感谢你的帮助!!!
 
命令:(ync)
错误:功能错误:“Yes”
命令:(ync)
错误:错误函数:“否”
命令:(ync)
*取消*

The Buzzard 发表于 2022-7-6 11:21:04

 
 
 
好的,看看这是不是你想要的。
 
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)
)

 
 
当然,您仍然需要提供自己的编码。

The Buzzard 发表于 2022-7-6 11:22:19

桑德森,
 
我不确定,但尝试从lisp中操作Quit命令可能不可行,但我也不确定。您需要了解如何在“退出”对话框中设置选项卡。此命令似乎无法从命令提示符中回答。
页: 1 [2]
查看完整版本: 从LSP调用DCL