Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dgnlspurge.dll creating a button or lisp help!

1 REPLY 1
Reply
Message 1 of 2
hdulrich
1097 Views, 1 Reply

dgnlspurge.dll creating a button or lisp help!

I have never written a lisp or anything like that, but recently someone asked me if I could figure out a way to write a lisp routine or create a button that would do several commands that we frequently need to do when opening a clients drawings.  I would like to set up a button that would run the dgnpurge command and the scalelistedit command along with purge.  Is this possible?   Any help would be greatly appreciated.

 

Thanks!

1 REPLY 1
Message 2 of 2
hmsilva
in reply to: hdulrich

 Hello hdulrich and welcome to the Autodesk Community!

 

To use the DGNPURGE command, you'll need to load the 'dgnlspurge.dll' first.
One way to do this, is adding to the acad.lsp (if you have one, if not just create one using notebook, or other, and save the file [set the 'Save as Type' panel to 'All Files'] as acad.lsp in a Support File Search Path directory, and add

(command "netload" "C:\\yourpath\\dgnlspurge.dll");; change the 'yourpath' to the correct one

 

AutoCAD only needs to load .dll files once per session, and adding the netload to the acad.lsp file, will be loaded only once.

 

To the .lsp file

(defun c:MyPurge ()
(command "dgnpurge")
(command "-scalelistedit" "add your prompt options...")
(command "purge" "A" "*" "N");; or your options
(princ)
)

 

add the prompt options in the '-scalelistedit' command, save the code as described to the 'acad.lsp' as 'MyPurge.lsp'

 

To the button 'change the yourpath to the correct one'

(if (null c:MyPurge)(load "c:\\yourpath\\MyPurge"));MyPurge;

 

Hope that helps
Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost