test : dialog{label = "test dialog" ;: button{label = "Ok" ;key = "accepted" ;height = 1 ;width = 13 ;is_default = true ;}};; The lisp file to run the dialog:(defun test ( / flag dcl_id)(setq dcl_id (load_dialog "test.dcl"))(setq flag (new_dialog "test" dcl_id))(if (null flag) (exit))(action_tile "accepted" "(test_accepted)(done_dialog)")(start_dialog)(unload_dialog dcl_id))(defun test_accepted ()(load "SomeLispFile.lsp")(princ "hello")(alert "hello again")(command "snap" "on"))
When i run the test function everything works fine until it reaches an AutoCad command (in this case snap), then AutoCad stops responding.
It seems to be when a command is runned within the dialog function.
Anyone who know anything about this please help me!
Besides that , your routine name which is SomeLispFile.lsp should be in the Acad support folder to be loaded and to let the routine running to end to put snap mode on also as well .
Each time a drawing is opened a lisp file i loaded and that one loads another and so on.
My goal is to reload this sequence when the ok button is pressed but that isn´t possible as long as there is command calls in the lisp files?
Thank you Lee Mac!
It took me a while to understand but now I see that I can use whatever I want if I just close the dialog first.
Quite obvious when you know it...
Nice to get an answer from a legend of this site! (I have seen your answers many times on this site before I registered myself.)