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.
Solved! Go to Solution.
Solved by dgorsman. Go to Solution.
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.
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.
I ended up using the registry setting to do it, it seemed easier in the end.
Thank you for the answers.
A little disappointed at that KB - somewhere between bad practices and wrong.
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....