Russello 发表于 2022-7-5 15:54:12

关于DCL的一个问题

大家好,大师和传奇,我现在正在通过Afralisp学习DCL。net和一些autodesk论坛主题。从他们的示例中,DCL文件与LSP文件配对工作。
 
例如,我有一个DCL和它的配对LSP文件,它的功能只是收集名称、一些数字、位置(和任何其他数据)。是否有任何其他LSP例程可以使用DCL上存储/输入的数据?如果是,怎么做?我只是不知道。
 
再次感谢。更强大!

dan113 发表于 2022-7-5 16:09:26

只要不进行本地化,存储在变量中的任何值都是可用的。我所有的对话框都使用opendcl,它更快、更灵活。
 
使用Tapatalk从my Pixel XL发送

Grrr 发表于 2022-7-5 16:27:09

您可以从lisp代码动态创建DCL文件,加载并启动对话框,然后收集所需输入并关闭对话框并擦除临时DCL文件。
举个例子:
 
(defun C:test ( / dcl des dch dcf rtn )
;; Example to create DCL on-the-fly and gather input(s)
;; Modified version, original by: Lee Mac
(defun *error* ( msg )
   (and (< 0 dch) (unload_dialog dch))
   (and (eq 'FILE (type des)) (close des))
   (and (eq 'STR (type dcl)) (findfile dcl) (vl-file-delete dcl))
   (and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\nError: " msg)))) (princ)
); defun *error*

(and
   (setq dcl (vl-filename-mktemp nil nil ".dcl"))
   (setq des (open dcl "w"))
   (princ
   (strcat
       "test : dialog"
       "{ label = \"Get String\";"
       ": column"
       "{ children_alignment = centered;"
       "    : text { value = \"Your input: \"; }"
       "    : edit_box { key = \"eb\"; edit_width = 26; }"
       "}"
       "spacer_1; ok_cancel;"
       "}"
   ); strcat
   des
   )
   (not (setq des (close des)))
   (< 0 (setq dch (load_dialog dcl)))
   (new_dialog "test" dch)
   (action_tile "eb" "(setq rtn $value)")
   (= 1 (setq dcf (start_dialog)))
   (princ rtn)
); and

(*error* nil) (princ)
); defun C:test

BIGAL 发表于 2022-7-5 16:52:02

与Grr一样,这里也有用于列表选择检查的动态DCL示例。com我有一个1 2 3输入值dcl,这里的事情是你提供的短信请求,另一个是一个无限版本的123只限于一个实际的屏幕限制。
 

; this is all that is needed for a 3 value request 2 lines of code
; its version 2 as it also has default values so you can just go OK
(if (not AH:GETVAL3)(load "getvals3"))
(ah:getval3 "Enter Hor scale" 5 4 "100" "Enter Ver Scale" 5 4 "50" "Enter Dec places" 5 4 "2")


GETVALS3.lsp

Russello 发表于 2022-7-5 17:04:13

你好,大师dan113,Grrr和BIGAL!再次感谢您的见解,感谢您总是在我的帖子中回答我的问题。我会尽力消化这些东西。
 
dan113,
我目前正在阅读opendcl的教程。祝我好运。呵呵呵呵
 
再次感谢各位大师
 
谨致问候,
罗素
页: [1]
查看完整版本: 关于DCL的一个问题