I get the following error on loading this in Autocad 2000i, does anyone know why? ;AutoCAD menu utilities loaded. ;Command: appload ;EXAMPLE.LSP successfully loaded. ;Command: example ; error: quit / exit abort ;Command: example ; error: quit / exit abort ;--- EXAMPLE.lsp - Text Find (defun saveVars() ;;;--- Save the input from the dialog box (setq textVal (get_tile "textval")) ) (defun C:EXAMPLE() ;;;--- Load the dcl file (setq dcl_id (load_dialog "EXAMPLE.dcl")) ;;;--- Load the dialog definition if it is not already loaded (if (not (new_dialog "EXAMPLE" dcl_id) ) (exit)) ;;;--- If an action event occurs, do this function (action_tile "cancel" "(setq ddiag 1)(done_dialog)") (action_tile "accept" "(setq ddiag 2)(saveVars)(done_dialog)") ;;;--- Display the dialog box (start_dialog) ;;;--- If the cancel button was pressed - display message (if (= ddiag 1) (princ "\n \n ...EXAMPLE Cancelled. \n ") ) ;;;--- If the "Okay" button was pressed (if (= ddiag 2) (princ "\n \n ...Example Complete!") ) ;;;--- Suppress the last echo for a clean exit (princ) ) ====DCL FILE NAMED EXAMPLE.DCL====== EXAMPLE : dialog { label = "EXAMPLE.lsp"; \\ Puts a label on the dialog box initial_focus = "textval"; \\ Sets the initial focus : column { : row { : boxed_column { : edit_box { \\ The edit_box control - Something new! key = "textval"; label = "Text Value to Find"; edit_width = 30; value = ""; } } } : row { : boxed_row { : button { key = "accept"; label = " Okay "; is_default = true; } : button { key = "cancel"; label = " Cancel "; is_default = false; is_cancel = true; } } } } }
Why do you assume it's a DCL problem and not related to the LSP? I don't really, I'm new to autolisp, and just starting to learn dcl, but I cannot find anything wrong with either the lsp or dcl file. But this is the first dcl file I've tried to load and it is "also" the first time I've gotten this error. Any ideas ?
Doesn't Autocad first check the "current" directory and then the directory of the Cad file loading the routine even before it checks all the path stuff? I have the dcl file in the directory that lsp file is in and I'm "apploading" the lsp file so maybe I need to move them to drawing directory, I will try that. I think maybe the reason my lsp only files were running ok is because I apploaded them from their current location so it had the path from the appload. But maybe the dcl file doesn't share the appload lookup.
Have you tried to debug the file checking variable values as you go? From the error message, it seems to abort on load, so it might just be a parenthesis problem, I dunno. Try running a simpler version of the lisp that doesn't need a dcl.
I didn't do an in depth analysis my friend but you'll definitely have a problem with those slashes your using to add comments. They're facing the wrong way. Dale
====== Ok, I will try reversing them, I got this example from the following link, it runs for other people that have tried it. I'm really puzzled as to why I cannot get "any" dcl to run so far? http://www.jefferypsanders.com/autolisp_DCL_OverView.html
Well I finally got some dcl files to run. I had to put the actual folder they were sitting in on the "Options>Path". Now I'm wondering if I have to do this manually on every machine I install a routine on, or is there a way to add a path from a lsp file? Or is there a way to determine the Support file Path of cad from an install application and just install it there. I've written a crude install app in C for windows that does work on all the machines in our office.
I've always put the DCLs where the LSPs go, and that folder is in the 'path' so the issue never came up.