woodman78 Posted December 2, 2009 Posted December 2, 2009 I am getting very frustrated with trying to get the acaddoc.lsp to load. The file is attached below. I have it placed on a networked drive that is listed as a support path. The only way I can get the lsp's to load is by adding them to the contents in the appload. When I remove them from there they don't run. The lisps and dialogs are stored in the same directory as the acaddoc.lsp. I would really appreciate some help on this as I can't figure it out. Is there some way I need to tell CAD to open it. acaddoc.lsp Quote
lpseifert Posted December 2, 2009 Posted December 2, 2009 Your first 4 lines are Command: (load "A1") LOAD failed: "A1" Command: (load "A1" nil) nil this is unfamiliar to me; is this the command line history, or the acaddoc.lsp file? If it's the acaddoc file, try replacing it with (load "A1") assuming A1 is actually A1.lsp and is located in the support path. Do the same for each of the routines you want loaded by the acaddoc.lsp. Quote
wizman Posted December 2, 2009 Posted December 2, 2009 .. I have it placed on a networked drive that is listed as a support path.. try also this: In your tools>options>files>support path, is your network drive on the topmost level? If not, click the button 'Move Up' and make network directory the topmost. Quote
rkmcswain Posted December 2, 2009 Posted December 2, 2009 Your first 4 lines are this is unfamiliar to me; is this the command line history, or the acaddoc.lsp file? If it's the acaddoc file, try replacing it with (load "A1") assuming A1 is actually A1.lsp and is located in the support path. Do the same for each of the routines you want loaded by the acaddoc.lsp. Ditto. :wink: Quote
Lee Mac Posted December 2, 2009 Posted December 2, 2009 ACAD will not recognise: "Command: " This is not LISP. Quote
Lee Mac Posted December 2, 2009 Posted December 2, 2009 This may help: http://www.cadtutor.net/faq/questions/53/How+do+I+automatically+load+variables%3F Or also: http://www.theswamp.org/index.php?topic=30946.0 Also, make sure you read the article on the "load" function in the Visual LISP Editor help: load Evaluates the AutoLISP expressions in a file ([color=Navy]load [/color][i]filename [onfailure][/i]) The load function can be used from within another AutoLISP function, or even recursively (in the file being loaded). Arguments filename A string that represents the file name. If the filename argument does not specify a file extension, load adds an extension to the name when searching for a file to load. The function will try several extensions, if necessary, in the following order: .vlx .fas .lsp As soon as load finds a match, it stops searching and loads the file. The filename can include a directory prefix, as in “c:/function/test1”. A forward slash (/) or two backslashes (\\) are valid directory delimiters. If you don't include a directory prefix in the filename string, load searches the AutoCAD library path for the specified file. If the file is found anywhere on this path, load then loads the file. onfailure A value returned if load fails. If the onfailure argument is a valid AutoLISP function, it is evaluated. In most cases, the onfailure argument should be a string or an atom. This allows an AutoLISP application calling load to take alternative action upon failure. Quote
woodman78 Posted December 2, 2009 Author Posted December 2, 2009 I feel really stupid now but i can't get this to work. i've tried it on a few different versions of cad but no joy. I ran then findfile acaddoc.lsp and it returns the right file in the right place but it just won't load the lsp's. Is there anything else it might be????? Quote
Lee Mac Posted December 2, 2009 Posted December 2, 2009 What does your ACADDOC.lsp look like now? Quote
woodman78 Posted December 2, 2009 Author Posted December 2, 2009 I tried someone else's pc and got it to work there. But to get it to work I had to out the acaddoc in the startup suite. I didn't think i had to do that. I repeated the procudure on my own machine but no joy. I am due an upgrade in the coming days so i'll see what happens then. Thanks. Quote
Lee Mac Posted December 2, 2009 Posted December 2, 2009 Each statement in the ACADDOC.lsp should be just something like: (load "A1" "Did not load!") (load "A3" "Did not load!") (load "Autonum V4.lsp" "Did not load!") etc And the ACADDOC.lsp should be saved to a directory in the Search path - that should be all you need. :wink: Quote
rkmcswain Posted December 2, 2009 Posted December 2, 2009 I tried someone else's pc and got it to work there. There is no way the code you posted in the original post loaded and worked. But to get it to work I had to out the acaddoc in the startup suite. I didn't think i had to do that. No. "acaddoc.lsp" will load by itself. More technically, AutoCAD will search for and load the first (and only the first) "Acaddoc.lsp" file it finds in the support file search path, starting at the top. Quote
Lee Mac Posted December 2, 2009 Posted December 2, 2009 More technically, AutoCAD will search for and load the first (and only the first) "Acaddoc.lsp" file it finds in the support file search path, starting at the top. Good point - might be worth you doing a search for any ACADDOC.lsp files to make sure there is only one... Quote
Recommended Posts
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.