请翻译
您好,我正在努力理解这里的一些Lisp程序的东西。如果你愿意的话,请用红色解释一下;;;;AUTOLISP CODING STARTS HERE
(prompt "\nType WSIPart to run.....")
(defun C:InsP ()
;;;--- Load the WSI Part DCL file
(setq dcl_id (load_dialog "InsP.dcl"));;;I'm assuming this sets dcl_id to InsP dialog box.
;;;---Load the dialog Definition if it is not already loaded
(if (not (new_dialog "InsP" dcl_id));;; I dont' understand this at all.
(exit )
);;;close if statment,i think I get the rest
(start_list "lvl1" 3)
(mapcar 'add_list lvl1)
(end_list)
(action_tile "insert"
"(done_dialog)"
);;; close action_tile
(start_dialog)
(unload_dialog dcl_id)
(princ)
);;;; close defun
(princ)
;;;;AUTOLISP CODING ENDS HERE
load_dialog语句加载DCL文件中定义的对话框(在本例中位于AutoCAD的搜索路径中),并返回一个整数,该整数用作稍后在代码中访问这些定义的句柄。
要准备显示对话框,将使用new_dialog语句–通过指定上述保留句柄,将能够指示对话框的“来源”。通过测试该定义的存在性(if),将能够决定是否继续或结束处理(如果不可用)。
可以填充列表或图像后,加载默认数据并定义与互动程序关联的操作。
下面的代码将遇到start_对话框语句,该语句将在屏幕上显示界面。
在您的示例中,是关于名为“InsP.DCL”的DCL文件的,该文件存储名为“InsP”的对话框定义。
希望这对你有帮助。
当做
页:
[1]