Hi,
I am updating a Steel Member Lisp drawing routine that calls up a DCL dialog box from where you pick what you want to have drawn, Eg select UC and a DCL dialoge box pops up with the member selction sizes and orientation variants available. It all works well except for the CANCEL button. You can cancel from the first dialogue box no problems but cancelling from the specific Steel Member dialoge box causes Autocad to freeze then crash. I have fiddled and got it not to crash but it draws the member anyway or you Esc Esc and get back to the command linr that way OK. Could have something to do with a hierachy of DCL pop up windows ie have to cancel back to the first selection windoe then reselsct or cancel from there.
Also there is no author credits, anyone know who wrote it?
All advice happly received.
thanks
Code from the Steel Member LISP file to cancel the routine which still draws the member,
(defun TFB( / dcl_id)
(initerr)
(setq os(getvar "osmode"))
(setvar "cmdecho" 0)
(setq dcl_id (load_dialog "stl_sect"))
(setq TFB_pt (if TFB_pt TFB_pt '(-1 -1)))
(if (not (new_dialog "stl_sect" dcl_id "" TFB_pt)) (exit))
(setq size 0)
(setq view "sect")
(setq cl "T")
(mode_tile "mirror" 1)
(mode_tile "near" 1)
(mode_tile "far" 1)
(set_tile "top" "1")
(set_tile "sect" "1")
(sect)
;-------------------------------------------------------------------
(setq TFB_list (list
"100 x 45 TFB"
"125 x 65 TFB"
)
)
(start_list "size")
(mapcar 'add_list TFB_list)
(end_list)
(set_tile "size" "0")
(c_list)
;-------------------------------------------------------------------
(action_tile "plan" "(plan)")
(action_tile "elev" "(elev)")
(action_tile "sect" "(sect)")
(action_tile "top" "(progn (setq cl \"T\")) (elevt)")
(action_tile "cen" "(progn (setq cl \"C\")) (elevc)")
(action_tile "size" "(progn (setq size (atoi $value))) (c_list)")
(action_tile "accept" "(setq TFB_pt (done_dialog 1))")
(action_tile "cancel" "(progn (done_dialog 0))")
(start_dialog)
(unload_dialog dcl_id)
(cond
((= view "plan") (TFBplan))
((= view "sect") (TFBsect))
((= view "elev") (TFBelev))
)
)
Also tried
(action_tile "accept" "(setq TFB_pt (done_dialog )")
(action_tile "cancel" "(progn (done_dialog) (setq usercheck 1)")
with the same result
This was the original code
(action_tile "accept" "(setq TFB_pt (done_dialog))")
(action_tile "cancel" "(progn (done_dialog) (quit))")