PDA

View Full Version : Dialog box within LISP routine causes AutoCAD to not respond


eleonard
2007-02-26, 04:25 PM
I have loaded a lisp routine that contains a dialog box. Once the dialog box opens autocad quits responding and i can't even select anything from my pull downs. What could cause this to happen?

EmilyL

Opie
2007-02-26, 04:44 PM
Someone here with experience with dialogs would probably need to see your lisp and the dialog code.

eleonard
2007-02-26, 04:54 PM
My husband always says to let people stew in a problem for a while and eventually they will figure it out.

I had placed some information in a place in my routine that it didn't like. I think I got it figured out.

Emily

kennet.sjoberg
2007-02-26, 06:05 PM
If you write the code in wrong order, it will hang AutoCAD
or in fact AutoCAD is waiting for user response from the dialog that your code not can handle.

: ) Happy Computing !

kennet

Adesu
2007-02-26, 11:57 PM
Hi Emily,
My experience if dialog box just opened and it hang,it ususally code in lisp without ";(setq ans (start_dialog))",test this code below.
LSP File

(defun c:ssi (/ ans dcl_id h w)
(setq dcl_id (load_dialog "Sample Show Image.DCL"))
(if
(not (new_dialog "shi" dcl_id))
(exit)
)
(setq w (dimx_tile "im"))
(setq h (dimy_tile "im"))
(start_image "im")
(vector_image 0 0 0 h 250)
(vector_image 0 h w h 250)
(vector_image w h w 0 250)
(vector_image w 0 0 0 250)
(slide_image 0 0 w h "Yuasa Logo")
(end_image)
;(setq ans (start_dialog))
(princ)
)

DCL File

shi : dialog {label = "SAMPLE SHOW IMAGE";
: column {label = "Preview of image";
: image {key = "img";
height = 20; // to set height of box image
width = 30; // to set height of box image
aspect_ratio = 1;
color = 2; // to set color of back ground
//is_enabled = false;
//is_tab_stop = false;
fixed_height = true;
fixed_width = true;}
ok_only;
}
}



I have loaded a lisp routine that contains a dialog box. Once the dialog box opens autocad quits responding and i can't even select anything from my pull downs. What could cause this to happen?

EmilyL