flowerrobot 发表于 2022-7-6 14:42:44

按钮错误

格戴。
我有个问题,在dcl里。我按下勾选框,然后选项被启用,然后当我按下下面的按钮时,它会做它需要做的事情,如果我按下它下面的任何一个按钮(2),你需要按几次才能工作,如果我先按这些按钮,我需要按几次顶部的按钮才能工作,还需要按几次接受和取消按钮才能工作。
 
这是代码按钮是“odget”“idget”“thkget”
 
 
任何帮助都会很棒
 
干杯

(defun pf ()
(setq pipematerialpreset '("MILD" "SS"))
;protection, if tiles are nil
(if (= pipesize nil)
(setq pipesize "2")
)
(cond
((= masstype "316 S.S.")
(setq material "1"))
((= masstype "MILD STEEL")
(setq material "0"))
)
(if (= flgod nil)
(setq flgod " ")
)
(if (= flgid nil)
(setq flgid " ")
)
(if (= flgthk nil)
(setq flgthk " ")
)
(setq flgthktype 0)
(setq toggle 0)
(defun flgio ()
(setq dialo (load_dialog "MainDCL"))
(if (not (new_dialog "Flangebox" dialo)) (exit))
;set up for data
;for pipe size
(start_list "pipeSize")   
(mapcar 'add_list Pipesizes)   
(end_list)
;for pipe material
(start_list "material")   
(mapcar 'add_list pipematerialpreset)   
(end_list)
;Pre-set tiles
(set_tile "pipeSize" pipesize )
(set_tile "material" material)
(set_tile "flgod" flgod)
(set_tile "flgid" flgid )
(set_tile "flgthk" flgthk )
(if (or (= flgtype "TABLED")(= flgtype nil))
(set_tile "tabled" "1")
)
(if (= flgtype "TABLEE")
(set_tile "tablee" "1")
)
(if (= flgtype "ANSI150")
(set_tile "ansi150" "1")
)
(if (= flgtype "ANSI300")
(set_tile "ansi300" "1")
)
;what to do settings
(if (= toggle 1)
(progn
(mode_tile "customflgdtls" 0)
(mode_tile "flgtype" 1)
(mode_tile "flgthktype" 1)
)
(progn
(mode_tile "customflgdtls" 1)
(mode_tile "flgtype" 0)
(mode_tile "flgthktype" 0)
)
)
(action_tile "stdthk" "(setq flgthktype 0)")
(action_tile "outtk" "(setq flgthktype 1)")
(action_tile "customflg" "(progn
(if (= toggle 1)
   (progn (mode_tile \"flgtype\" 0) (mode_tile \"flgthktype\" 0) (mode_tile \"customflgdtls\" 1) (setq toggle 0)
    )
   (progn (mode_tile \"flgtype\" 1) (mode_tile \"flgthktype\" 1) (mode_tile \"customflgdtls\" 0) (setq toggle 1)
      )
   ) )"
)
(action_tile "cancel" "(setq ok 0)
   (done_dialog)"
)
(action_tile "accept" "(setq ok 1)
   (setq pipesize (strcase(get_tile \"pipeSize\")))
   (setq material (strcase(get_tile \"material\")))
   (setq flgod (strcase(get_tile \"flgod\")))
   (setq flgid (strcase(get_tile \"flgid\")))
   (setq flgthk (strcase(get_tile \"flgthk\")))
   (setq flgtype (strcase(get_tile \"flgtype\")))
   (done_dialog)")
(action_tile "odget" "(setq ok 2)
      (setq pipesize (strcase(get_tile \"pipeSize\")))
      (setq material (strcase(get_tile \"material\")))
      (setq flgod (strcase(get_tile \"flgod\")))
      (setq flgid (strcase(get_tile \"flgid\")))
      (setq flgthk (strcase(get_tile \"flgthk\")))
      (setq flgtype (strcase(get_tile \"flgtype\")))
      (done_dialog)")
(action_tile "idget" "(setq ok 3)
      (setq pipesize (strcase(get_tile \"pipeSize\")))
      (setq material (strcase(get_tile \"material\")))
      (setq flgod (strcase(get_tile \"flgod\")))
      (setq flgid (strcase(get_tile \"flgid\")))
      (setq flgthk (strcase(get_tile \"flgthk\")))
      (setq flgtype (strcase(get_tile \"flgtype\")))
      (done_dialog)")
(action_tile "thkget" "(setq ok 4)
      (setq pipesize (strcase(get_tile \"pipeSize\")))
      (setq material (strcase(get_tile \"material\")))
      (setq flgod (strcase(get_tile \"flgod\")))
      (setq flgid (strcase(get_tile \"flgid\")))
      (setq flgthk (strcase(get_tile \"flgthk\")))
      (setq flgtype (strcase(get_tile \"flgtype\")))
      (done_dialog)")
(start_dialog)
(unload_dialog dialo)
)
(flgio)
(while (not (or (= ok 1) (= ok 0)))
(if (= ok 2)
(setq flgod (rtos (getdist "\nWhat is the Flanges O.D")2 0))
(flgio)
)
(if (= ok 3)
   (setq flgid (rtos (getdist "\nWhat is the Flanges I.D")2 0))
(flgio)
)
(if (= ok 4)
   (setq flgthk (rtos (getdist "\nWhat is the Flanges Thickness")2 0))
(flgio)
)
)
)
页: [1]
查看完整版本: 按钮错误