Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading a .dll at startup

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
briscaLRNDN
5738 Views, 4 Replies

Loading a .dll at startup

I've seen the the article at https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to..., but i'm still having troubles getting the .dll to load at startup.

Where in the file acad20xxdoc.lsp do I put my netload command? That file for me is located at C:\Program Files\Autodesk\Autodesk AutoCAD Map 3D 2014\Support\en-us, does that make a difference?

 

I know the .dll works because I can type netload in the command bar, browse to it, and it loads.

4 REPLIES 4
Message 2 of 5
rkmcswain
in reply to: briscaLRNDN

Do not edit that file. Create a new file named "acaddoc.lsp" and put your code in there. For greater flexibility, create a new folder (for example: C:\CADSTUFF) and put your "acaddoc.lsp" file in there, then add this folder to the TOP of your support file search path.

Done.

As for the contents of this file, you can do it like this:

(setq dllFile (strcat MyPath "DGNPurge.dll"))
(if (findfile dllFile)(vl-cmdf "netload" dllFile))


Or you might choose to do something like this (demand load it)

(defun c:myFunc ()
  (vl-cmdf "netload" (strcat DllPath "MyFunc.dll"))
  (vl-cmdf "MyFunc")
)



Doing it this way only loads the DLL if the function is called.

R.K. McSwain     | CADpanacea | on twitter
Message 3 of 5
dgorsman
in reply to: briscaLRNDN

A little disappointed at that KB - somewhere between bad practices and wrong.

 

Do NOT use the LSP files with the version number in the name (ACAD____.LSP, ACADDOC____.LSP).  Those are reserved for use by the program.  Create your own ACAD.LSP and ACADDOC.LSP files, which will execute when the program loads (ACAD.LSP) and when each document loads (ACADDOC.LSP).  Since DLLs are loaded for the session and cannot be unloaded, that should only be used with the former.

 

But I would recommend you use the Option B provided - set up a registry key for demand loading, or look into creating an auto-loader bundle.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 4 of 5
briscaLRNDN
in reply to: dgorsman

I ended up using the registry setting to do it, it seemed easier in the end.

Thank you for the answers.

Message 5 of 5
rkmcswain
in reply to: dgorsman

dgorsman wrote:

A little disappointed at that KB - somewhere between bad practices and wrong.

Wow, I just went and read that "kb" article.

Unbelievable. That information is no better than a random forum post or something you find on reddit, etc.

The KB articles are supposed to be gold, trustworthy information. They used to be years ago. Oh well....

R.K. McSwain     | CADpanacea | on twitter

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost