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!
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