Jump to content

Recommended Posts

Posted

Gday.

Im suffering from a problem, where in dcl. i press a tick box, then options are Enabled, then when i push the button below, it does what it needs, if i do either buttons below it (2), you need to press them a few times to work, if i do those buttons first i need to press that top button a few times to work and need to press accept and cancel buttons a few times to work aswell.

 

heres the code the buttons are "odget" "idget" "thkget"

 

 

any help would be awesome

 

cheers

flower

(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)
  )
  )
 )

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...