Bobzy20 Posted November 21, 2013 Posted November 21, 2013 I want to add the DGNLSPURGE.DLL command to my AutoCAD 2012 start-up lisp so I don’t have to keep typing NETLOAD and manually adding it each time I need to use it. I found this on the net which makes total sense although I can’t get it work. If you want to incorporate the NETLOAD of the DGNLSPURGE.DLL command into your start up lisp routine so it loads on every workstation once you’ve rolled out the DBX file firm-wide, you can add the following code to your acad2014.lsp (or acad2013.lsp) as it runs the first time AutoCAD is launched and will allow you to run the DGNPURGE command without manually loading the DLL first. Sample Code: (command “netload” “C:\\Program Files\\Autodesk\\AutoCAD 2014\\DgnLsPurge.dll”) My Code: (command “netload” “C:\\Program Files\\Autodesk\\AutoCAD 2012 - English\\DGN Hotfix\\DgnLsPurge.dll”) Where about would the code go inside the acad2012.lsp file, right at the very bottom? Quote
feargt Posted November 21, 2013 Posted November 21, 2013 do not edit the acad2xxx.lsp file. (it is not good practice. If autocad releases a new sercvicepack for a product they may replace this file for what ever reason then you will simply lose any custom code you put in there. create your own acaddoc.lsp file and put your code in there. save in one of the support folders for your Autocad. AutoCAD will automatically load the first acaddoc.lsp file it finds in the support folders in each drawing. Quote
Lee Mac Posted November 21, 2013 Posted November 21, 2013 do not edit the acad2xxx.lsp file. (it is not good practice. If autocad releases a new sercvicepack for a product they may replace this file for what ever reason then you will simply lose any custom code you put in there. create your own acaddoc.lsp file and put your code in there. save in one of the support folders for your Autocad. AutoCAD will automatically load the first acaddoc.lsp file it finds in the support folders in each drawing. Agreed - Here is some more information on the acaddoc.lsp file: The ACADDOC.lsp File Information on the loading order of AutoCAD Startup files As for the code, I would suggest something along the lines of: ( (lambda ( / dll ) (if (setq dll (findfile "DgnLsPurge.dll")) (command "_.netload" dll) (princ "\nDgnLsPurge.dll not found.") ) (princ) ) ) Quote
rkmcswain Posted November 21, 2013 Posted November 21, 2013 (edited) What everyone else said, except I use "acad.lsp" since the .dll file only needs to be loaded once per session, not for every drawing. Also to add what feargt said, since AutoCAD will load the first "acad.lsp" and "Acaddoc.lsp" it finds (by searching the support file search path from top to bottom) - I always recommend creating your own directory (something like C:\CADSTUFF) and putting your custom files in there, then add that path to the TOP of your support file search path. When you upgrade, or get a new machine or want to take your custom stuff home or share with a friend, all you have to do it copy that directory and add the path to AutoCAD. Edited November 21, 2013 by rkmcswain add more info Quote
Bobzy20 Posted November 21, 2013 Author Posted November 21, 2013 Thanks for the replies, I will have a go and let you know. Quote
Bobzy20 Posted November 25, 2013 Author Posted November 25, 2013 So I’ve added a folder called "CADSTUFF" to the C: drive (C:\CADSTUFF) and made a copy of the "acad.lsp" file and pasted it in this directory. I’ve opened the lsp file and deleted all the information and then copied the code that Lee Mac suggested: .............................................................................. ( (lambda ( / dll ) (if (setq dll (findfile "DgnLsPurge.dll")) (command "_.netload" dll) (princ "\nDgnLsPurge.dll not found.") ) (princ) ) ) .............................................................................. Where does the "DgnLsPurge.dll" file need to be for that code to find it, in the CADSTUFF directory or in the "C:\Program Files\Autodesk\AutoCAD 2012 - English\Support" directory? I’ve also added the custom directory (C:\CADSTUFF) to the top of the support file search path within AutoCAD. Quote
Bobzy20 Posted November 25, 2013 Author Posted November 25, 2013 (edited) It seems to be working now. Its picking up the "DgnLsPurge.dll" file from the "C:\Program Files\Autodesk\AutoCAD 2012 - English\Support" directory. Also I thought i could rename the "acad.lsp" file to something else (custom name) but it wouldn't find the .dll file when doing this. Edited November 25, 2013 by Bobzy20 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.