flowerrobot 发表于 2022-7-6 14:50:05

一个简单的。dcl问题,使用

格戴!
我希望我的选项中的所有内容都与我的变量相关,这样它将为我提供3个40 50 60的按钮,而不是简单的“选项1”,但我无法解决它。
 
谢谢大家!!
 
;lsp
(defun c:trail ()
;done by other equations & input
(setq bltlength 40)
(setq bltlenghtop1 50)
(setq bltlenghtop2 60)
;creating diffent options
(setq Option1 (itoa bltlength))
(setq Option2 (itoa bltlenghtop1))
(setq Option3 (itoa bltlenghtop2))
   ;dcl loading
(setq testload (load_dialog "Length options"))
(if (null $MYFORM!)
(setq $myform1 "Option1")
)

(cond
((new_dialog "myform" testload)
(set_tile "options" $myform1)
; (change-form $mymform1)
(action_tile "Option1" "(setq bltlenghttot bltlength)")
(action_tile "Option2" "(setq bltlenghttot bltlenghtop1)")
(action_tile "Option3" "(setq bltlenghttot bltlenghtop2)")   
(action_tile "accept" "(setq ok 1) (done_dialog)")
(action_tile "cancel" "(setq ok 0) (done_dialog)")
(start_dialog)
(unload_dialog testload)
)
(t (princ "The dcl was not loaded"))
)
;to say what length was selected
(princ (itoa bltlenghttot))
(princ)
)



 
 
 

;dcl code
myform : dialog {
   label = "Mulitple lengths Avalible" ;
   : boxed_radio_column {
         Key = "options" ;
               label = "What length do you want?";
      : radio_button {key = "Option1" ; label = Option1; }
      : radio_button {key = "Option2" ; label = Option2; }
      : radio_button {key = "Option3" ; label = Option3; }
      }
   ok_cancel;
   }

 
 
 
 
 
 
 
此外,规划一个全dcl程序,其中每行有4个选项“edit_box”es,编号为qtq mass。
我应该如何使用取每个名字,它有至少4个数字到乘以来获得质量等,当它可能是1-100行,而不使代码100次,我希望我解释这个可以理解

David Bethel 发表于 2022-7-6 15:06:43

我不太明白。您希望DCL标签是动态的吗?如果是这样,则每次都必须重新生成DCL文件。做一些小动作并不难。如果需要的话,我会挖一个样品-大卫

David Bethel 发表于 2022-7-6 15:25:32

找到了
大卫

Lee Mac 发表于 2022-7-6 15:29:58

也许是这样的性质:
 

(defun c:write-dcl(/ file dclLst)
(setq    file   (open "myDCL.dcl" "a")
   dclLst (list
      "myform : dialog {"
      "label = \"Multiple lengths Available\";"
      ": boxed_radio_column {"
      "key = \"options\";"
      "label = \"What length do you want?\";"
      (strcat ": radio_button {key = \"Option1\" ; label = " Option1 "; }")
      (strcat ": radio_button {key = \"Option2\" ; label = " Option2 "; }")
      (strcat ": radio_button {key = \"Option3\" ; label = " Option3 "; }}")
      "ok_cancel;}"))
(mapcar '(lambda (x) (write-line x file)) dclLst)
(close file)
(princ))

flowerrobot 发表于 2022-7-6 15:44:40

谢谢你,我在家试一试。
如何删除文件?或者更重要的是,如果文件存在,如何搜索
?
我没看过,但如果你从头知道。
 
再次感谢!

Lee Mac 发表于 2022-7-6 15:52:59

 
您可以使用(findfile“…filename”)在搜索目录中搜索文件。
 
也许要删除:
 
4
 
^^小心这个!
页: [1]
查看完整版本: 一个简单的。dcl问题,使用