tsynnott
asked on
What controls the ability to run a LISP routine from the command line?
I have a custom CUI from which I am able to run a LISP routine; however, when I attempt to run the same routine from command line I get 'unknown command.' Is there file I'm not aware of in which routines called from the command line are defined?
ASKER
silverkorn - sorry, I was NOT clear enough.
More precisely, the problem is with calling a custom command from a menu item contained in a partial CUI. The command, as shown, is RELIMIT. Since the command is defined as RELIMIT on the Comand Name line I expected that this would be the value submitted from the command line. The operation works when selected from the menu in the partial CUI, but when entered from the command line I get the following message: Unknown command "RELIMIT".
More precisely, the problem is with calling a custom command from a menu item contained in a partial CUI. The command, as shown, is RELIMIT. Since the command is defined as RELIMIT on the Comand Name line I expected that this would be the value submitted from the command line. The operation works when selected from the menu in the partial CUI, but when entered from the command line I get the following message: Unknown command "RELIMIT".
You are getting this error because you are creating a Menu Item and not necessarily a command line shortcut. The field "Command Name" is for "Displays the name of the Macro"
the easiest and quickest solution to your problem is to edit your LISP function to accept the command RELIMIT instead of RLIMIT
to do that open the LISP file in notepad and change the line that should look like:
(defun c:rlimit ( TO:
(defun c:relimit (
then you need to change your macro command to:
^C^C(if (= relimit nil) (load "DLCRLMIT")) (relimit)
the easiest and quickest solution to your problem is to edit your LISP function to accept the command RELIMIT instead of RLIMIT
to do that open the LISP file in notepad and change the line that should look like:
(defun c:rlimit ( TO:
(defun c:relimit (
then you need to change your macro command to:
^C^C(if (= relimit nil) (load "DLCRLMIT")) (relimit)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found a .lsp file with what appeared to be load strings for a variety of menu commands that I am able to run from the command line in AutoCAD 2002. I copied the file to the Support folder on the 2009 machine, renamed it to ACADDOC.LSP, launched AutoCAD, loaded a file, entered RELIMIT in the command line and watched as the routine ran. Thanks for working with me on this.
In this window you can see a listing of applications (LISPs) that are currently loaded and also a history of previously used applications. You can also add or remove applications that you wish to load with AutoCAD's startup, see image for more detail
To run your custom LISP, make sure it is listed in the 'Startup Suite'. This will ensure that your LISP will always load with AutoCAD