cmatthews Posted July 1, 2011 Posted July 1, 2011 I just installed a lisp file to draw steel shapes. Now, when i type the "e" key for erase, the program closes. Anyone know why or how to get the erase command back? When I view the acad.pgp file, e is associated with the erase command. Quote
rkmcswain Posted July 1, 2011 Posted July 1, 2011 (edited) Command aliases in the PGP file are at the bottom of the stack. Lisp functions that define a command for "e" will overwrite the definitions in PGP. Contact the author of the program and ask them why they are hijacking your shortcuts without asking. Last resort, brute force method = load this lisp function. (defun C:E () (command "._erase") (princ) ) Edited July 1, 2011 by rkmcswain Quote
cmatthews Posted July 1, 2011 Author Posted July 1, 2011 Thanks for the reply. I wrote the lisp function you gave me and no luck. I have determined that the first time i open a file after a clean re-install, the e command is erase. After closing and opening Autocad a second time, e (erase) is replace with an immediate exit without the save option. This seems very dangerous! Any thoughts? Quote
rkmcswain Posted July 1, 2011 Posted July 1, 2011 Define what you mean by "I wrote the lisp function you gave me and no luck". If you copy and paste that code to the AutoCAD command line, you should get this: Command: (defun C:E () (_> (command "._erase") (_> (princ) (_> ) C:E Command: Notice the line that says "C:E". Now if you type in "E" and enter, it should launch the ERASE command. Quote
cmatthews Posted July 1, 2011 Author Posted July 1, 2011 Ok Did that and it worked while i was in that drawing. Closed and opened another and back to closing program. How do you make this a permanent change to the program? Quote
rkmcswain Posted July 1, 2011 Posted July 1, 2011 Ok Did that and it worked while i was in that drawing. Closed and opened another and back to closing program. How do you make this a permanent change to the program? Difficult to answer correctly without knowing what your "steel shapes" program is doing. Start by pasting this to the command line: (findfile "acaddoc.lsp") If it returns a path and file name, open this file and paste the "erase lisp code" to the bottom of this file, save it and then open a new drawing, and test. If the (findfile) string returns "nil" - then create this file in Notepad and add the "erase lisp code" to it. Then create a new directory on your hard drive (name it something like "C:\CADSTUFF"). Save the newly created "Acaddoc.lsp" file into this new directory. (Make sure the file extension is .lsp" and that Notepad does not add a .txt on the end) Now open AutoCAD and add this new path (C:\CADSTUFF) to the TOP of your support file search path (Options command, Files tab) Open a new drawing, and test. NOTE: You do not *have* to create the new directory, you could just place the new "Acaddoc.lsp" file in the current top directory of the support file search path, but by creating a new unique directory - you can point any version of AutoCAD here, easily copy it to take to another machine, etc. In other words, keep all your custom stuff in a unique directory that is easy to find, backup, etc. Quote
irneb Posted July 2, 2011 Posted July 2, 2011 RK, that's "supposed" to work ... but there are scenarios where it could still become overwritten (e.g. if the new lisp routine is loaded after the acaddoc.lsp file). You could of course fiddle with the S::Startup routine to force loading it as the very last defun, but even there it's not a fool-proof method. To the OP: Before you do this, just type !C:E at the command prompt (notice the exclamation prefix), if it shows anything else than nil, you could run into some problems as it's then a defined lisp function/variable which might even overwrite the fix that RK gave you. If such is the case, I'd actually advise trying to fix this in the original lisp, and then notifying the creator so they know their lisp is causing problems. Quote
Jack_O'neill Posted July 2, 2011 Posted July 2, 2011 Another thing you guys might want to consider is editing the "steel shapes" lisp so that it doesn't change the "e" shortcut again. That of course would require seeing the code of that lisp, but wouldn't that be a better alternative than strong arming it to change the "e" back every time? Quote
irneb Posted July 2, 2011 Posted July 2, 2011 That was my suggestion too. Rather remove the problem than try to medicate it :wink: Quote
Jack_O'neill Posted July 2, 2011 Posted July 2, 2011 That was my suggestion too. Rather remove the problem than try to medicate it :wink: Oh yeah....DUH..sorry. More caffiene before typing from now on for me. Quote
SLW210 Posted July 6, 2011 Posted July 6, 2011 I just installed a lisp file to draw steel shapes. Now, when i type the "e" key for erase, the program closes. Anyone know why or how to get the erase command back? When I view the acad.pgp file, e is associated with the erase command. Try a different LISP file or use the "Delete" key. Which LISP are you using? My worry would be this file is messing up "as yet unknown" commands and/or system variables, etc. 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.