How to upload many autolisp application files at one time

How to upload many autolisp application files at one time

nilambaridal28
Contributor Contributor
1,645 Views
13 Replies
Message 1 of 14

How to upload many autolisp application files at one time

nilambaridal28
Contributor
Contributor

I have 12 Autolisp application files which I have loaded in startup suite. But while whenever I start the AutoCad, only some of the autolisp application get load. SO every time for every individual drawing I have to load all autolisp application files individually.
Attached is the screen shot of my autolisp application files. Please advise me how to load all application files only one time, which will save my time loading time for every individual drawing. Thanks!

 

 

1,646 Views
13 Replies
Replies (13)
Message 2 of 14

roland.r71
Collaborator
Collaborator

They should all get loaded. SO, there's something wrong (with one or more of them) ...

 

Do they all contain functions? (instead of code which executes directly)

Does Acad report anything at startup? (hit F2 & check for messages)

 

An alternative would be to add them to acaddoc.lsp (loaded with each drawing)

Note that you will likely get the same result.

 

Be aware that in order to function any lisp should be loaded with each drawing. You canNOT load each lisp file only one time at startup and use it with each drawing. Unless your lisp should only run one time each session. (you can use acad.lsp for those)

 

Add them as follows:

(load "PN2")
(load "PN3")
(load "PND")

 

etc.

But; again, they should get loaded already, so there's something (else) wrong with your lisps.

0 Likes
Message 3 of 14

Kent1Cooper
Consultant
Consultant

Assuming they're all in locations in the Support File Search Path list, and their names are all spelled correctly, I couldn't say why they're not all loading.  But you could try having them loaded by an acaddoc.lsp file instead of by the Startup Suite:

 

(load "PN2.lsp")

(load "PN3.lsp")

(load "PND.lsp")

… etc.

Kent Cooper, AIA
0 Likes
Message 4 of 14

3wood
Advisor
Advisor

Just combine them into one lisp file with your Windows Notepad.

0 Likes
Message 5 of 14

roland.r71
Collaborator
Collaborator

I wouldn't do that.

- It makes adjustments/updates to the code that much harder.

- You lose sight of what's in there (functionallity)

- It has hardly any advantage over using acaddoc.lsp (with large numbers of lisp files you *might* speed it up a nano-second with just 1 file)

- It's not going to solve his problem, being: there is a reason not all files load and it ain't a limitation of appload. There's something wrong which prevents acad from loading all files.

- If there's an error with part of the code, good luck finding it inside a 12x bigger haystack.

 

I would:

Find the problem & solve it, instead of blaming appload & try alternatives to do the same, with same result, if the problem is erronous lisp code (or incorrect settings, or ...))

 

All files should get loaded. As they don't, 1 or more is causing problems.

 

To find which file is causing problems:

Remove all from startsuite.

Add them back in 1 by 1, (& test each time) until the problem occurs. The one you added last, is (most likely) the source.

 

Although it could already be clear after hitting F2 and looking at the various messages.

0 Likes
Message 6 of 14

ВeekeeCZ
Consultant
Consultant

@nilambaridal28 wrote:

I have 12 Autolisp application files which I have loaded in startup suite. But while whenever I start the AutoCad, only some of the autolisp application get load. SO every time for every individual drawing I have to load all autolisp application files individually....

Read HERE about your options. It's true, that the suitcase is not much reliable in newer versions.

I prefer autoload.

 

Off topic @Discussion_Admin It's nice to see again who am I replying to!

 

0 Likes
Message 7 of 14

Moshe-A
Mentor
Mentor

@nilambaridal28  Hey,

here a beautiful trick autocad has for long time:

place autocad window to occupy about half screen (or less) beside the folder with your 12 lisps.

Now  drag & drop the lisps (one at a time) to the drawing area, this will load the lisp

if somthing is wrong with the lisp (code), then an error is sent and lisp won't be available

also watch the command line, if the lisp starts as soon as it load, then this is also a cause that it is not suitable to be load from startup suite. there may be (c:XXX) call at bottom, if you remove (or just put it as comment),

then you can load it from startup suite.

 

Moshe

 

 

0 Likes
Message 8 of 14

roland.r71
Collaborator
Collaborator

In adition, one should check for conflicting functionnames and globals and such ...

Even if each lisp will load & run correctly, they can have conflicts preventing them from loading and/or working correctly side by side.

0 Likes
Message 9 of 14

doaiena
Collaborator
Collaborator

My advice would be to open the Visual Lisp IDE, and open all 12 files there. You can check them one by one and if there is an obvious error in the code, the IDE will warn you. If there isn't an obvious error in the code, enable "Break On Error" and start loading the files in the drawing one by one. When one of them fails to load, go to the break point and start from there. If the files contain only functions, and do not execute any code on load, it's for sure a syntax error you are dealing with. If these routines work on another instance of AutoCAD, make sure the files don't contain variables, or functions that aren't avaliable in your version of AutoCAD /happens sometimes when going from a newer version to an older one/.

Basically thats it. Go through these steps and you'll find what is causing the error.

0 Likes
Message 10 of 14

Moshe-A
Mentor
Mentor

it's true if one knows how to do it?! if OP come here with this kind of question then i think he is a lisp user.

(forgive me if i'm worng?)

 

 

 

 

0 Likes
Message 11 of 14

john.uhden
Mentor
Mentor

By all means use your own acaddoc.lsp.

I still do things in a very old-fashioned way...

 

(setq OK 0)
(load "PN2.lsp")
(setq OK 1)
(load "PN3.lsp")
(setq OK 2)
(load "PND.lsp")
(setq OK 3)
;; etc.

When all is done, check the value of OK.  It will tell you where the faulty line may have occurred, meaning that if OK is only at 2, then PND.lsp has some kind of problem.  Then remark out that line and try again, and see how far it gets.  It doesn't have to be "ok", it could be any unique symbol name you like, e.g. "okay" or "oksofar" or  "testing" or "igzlpig."

John F. Uhden

0 Likes
Message 12 of 14

martti.halminen
Collaborator
Collaborator

After you have debugged your system enough to make it load correctly, you could further streamline this by compiling all the .lsp files into one .vlx file to speed up the loading.

 

We are loading a single .vlx via acaddoc.lsp, created from 63 .lsp files, about 1700 defuns, about 33000 lines of program text. Takes less than one second to load.

 

-- 

 

0 Likes
Message 13 of 14

nilambaridal28
Contributor
Contributor

Hello all, thanks everyone for your reply. Sorry I am replying to this after long time. I tried to upload program in startup, it shows "error: extra right paren on input", but when upload one by one it works. What can be the error?

0 Likes
Message 14 of 14

roland.r71
Collaborator
Collaborator

@nilambaridal28 wrote:

Hello all, thanks everyone for your reply. Sorry I am replying to this after long time. I tried to upload program in startup, it shows "error: extra right paren on input", but when upload one by one it works. What can be the error?


 

That's obvious. One of the files loaded triggers an "error: extra right paren on input" error, when all the files are read sequential. Loaded one by one the error is still there, but might not get detected. (afaik, it should be)

 

There realy is something wrong with the lisp code for at least one of the files.

 

As I mentioned before: Remove all from startup, add 1 by 1, until the error occurs. Check the code of the last file added (and/or the one before that, if the last is ok). THAT's where the error is.

0 Likes