David Bethel 发表于 2022-7-5 18:54:37

嗯,我刚才在想的另一件事是,有没有一种方法可以编辑代码,这样我就可以用windows用户名和我想在REVBY属性中自动输入的缩写创建一个主列表?没有对话框。。我们可以将其称为C:REVBY,然后我可以将该命令移植到我编写的“plot”例程中。这样,当他们运行plot命令时,即C;DPA,它将像普通一样运行绘图,但在绘图之前也有C:REVBY,这样他们就不必手动键入另一个命令来更新其首字母。。。我注意到的另一个步骤被遗忘了。感谢所有帮助。谢谢

tmelancon 发表于 2022-7-5 18:56:54

请尝试以下操作:
;; List Select Dialog (Temp DCL list box selection, based on provided list)
;; title - list box title
;; label - label for list box
;; height - height of box
;; width - width of box
;; multi - selection method ["true": multiple, "false": single]
;; lst - list of strings to place in list box
;; Alan J. Thompson, 09.23.08 / 05.17.10 (rewrite)
(defun AT:ListSelect (title label height width multi lst / fn fo d f)
(setq fo (open (setq fn (vl-filename-mktemp "" "" ".dcl")) "w"))
(foreach x (list (strcat "list_select : dialog { label = \"" title "\"; spacer;")
                  (strcat ": list_box { label = \"" label "\";" "key = \"lst\";")
                  (strcat "allow_accept = true; height = " (vl-princ-to-string height) ";")
                  (strcat "width = " (vl-princ-to-string width) ";")
                  (strcat "multiple_select = " multi "; } spacer; ok_cancel; }")
            )
   (write-line x fo)
)
(close fo)
(new_dialog "list_select" (setq d (load_dialog fn)))
(start_list "lst")
(mapcar (function add_list) lst)
(end_list)
(setq item (set_tile "lst" "0"))
(action_tile "lst" "(setq REVBY $value)")
(setq f (start_dialog))
(unload_dialog d)
(vl-file-delete fn)
(if (= f 1)
   ((lambda (s / i s l)
      (while (setq i (vl-string-search " " s))
      (setq l (cons (nth (atoi (substr s 1 i)) lst) l))
      (setq s (substr s (+ 2 i)))
      )
      (reverse (cons (nth (atoi s) lst) l))
    )
   item
   )
)
)

tmelancon 发表于 2022-7-5 18:58:15

天才虽然你已经知道了。来自美国的祝福李和感恩节快乐!

Lee Mac 发表于 2022-7-5 19:03:04

谢谢,我很高兴能帮上忙

tmelancon 发表于 2022-7-5 19:06:35

嘿,李,我的一个同事刚刚提出了一个有效的观点,这真的没什么大不了的,因为无论如何,我更喜欢更改缩写。当用户打开一个图形只是为了打印而不改变任何东西时,有没有一种方法可以在其中写入if语句。。意思是没有更改,然后忽略正在更改的用户首字母?

Lee Mac 发表于 2022-7-5 19:08:51

嗯,上面的请求比这个请求最不重要。。是否有方法添加另一条语句来交叉检查DRAWBY或DRAWNBY属性中的这些首字母,如果DRAWBY或DRAWNBY首字母与当前用户完全相同,则不要为REVBY、REVIBY属性标记值输入首字母。。只是一个想法。

tmelancon 发表于 2022-7-5 19:13:03

 
只是不运行命令?

tmelancon 发表于 2022-7-5 19:16:46

这完全有道理,我向你们保证,我想了一下,哈哈,但是我保证,我的命令与我们的plot命令相结合,因为大多数用户往往忘记更改他们的缩写,所以我冒昧地以编程方式进行了更改。这很好,虽然真的没什么大不了,我只是好奇。

Lee Mac 发表于 2022-7-5 19:18:30

tmelancon 发表于 2022-7-5 19:20:30

That would make total sense and I assure you I gave it some thought, lol, I promiseHowever, I have the command piggybacking with our plot command because most users tend to forget to change their initials so I took the liberty to do it programmatically. Its fine though really no big deal I was just curious.
页: 1 [2]
查看完整版本: 单属性编辑LISP