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

Creating a Lisp to run multiple lisp routines...

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
705 Views, 11 Replies

Creating a Lisp to run multiple lisp routines...

I am a newbie to Autolisp, so please forgive me for the very basic question. I have created several lisp files for AutoCAD 2008 which reside in the acad.lsp file. They all work perfectly this way. The problem comes when I try to write a lisp file to combine some of these routines. It just tells me "Command Unknown" and moves on to the next part of the lisp. Does anyone know what is going on and how to fix it?
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

Try moving all your commands from acad.lsp ....... to acaddoc.lsp
That way, for each drawing you open, they should be available.

Bob
Message 3 of 12
Anonymous
in reply to: Anonymous

Sorry, but that didnt fix it. Any other ideas?
Message 4 of 12
Anonymous
in reply to: Anonymous

Sorry, but that didnt fix it. Any other ideas?
Message 5 of 12
Anonymous
in reply to: Anonymous

not sure what you are really needing, but if you've created a few routines by themselves, then I would assume at the command prompt you could type the "command name", and off it goes. now, if you're goal is to create a routine (in which you still need to invoke) that will run other routines (not by the user), then you need to modify your original routines.

example,
(defun c:set_mode (. . .<--- this routine can be executed from the command prompt due to the c:
(defun set_mode (. . . <---now, this routine can only be used withen another lisp routine

hope this helps
Message 6 of 12
Anonymous
in reply to: Anonymous

forgot about one other option. . you can create an ACAD.LSP file, and put all your lisp routines in it. This file can load automatically for every new session. and you can still call them up at the command prompt without modifing the individual routines. .

good luck
Message 7 of 12
Anonymous
in reply to: Anonymous


I'll assume that your routines are defined with
things like

 

(defun C:ABC () ...... )


(defun C:XYZ () ...... )

 

If you're calling for them within another routine by using something
like

 

(command "ABC" ..... )


(command "XYZ" ..... )

 

then I think that may be your problem.  I
believe (command) functions only operate with native AutoCAD commands -- that
would be why these are "unknown."  Try using

 

(C:ABC)

(C:XYZ)

 

instead.  Or if they're defined as
sub-routines without "command" names [i.e. without the C: in the (defun) header
line], they should work with just

 

(ABC)

(XYZ)


face=Arial size=2>

size=2>

--
Kent Cooper

 

 

springinlizard wrote...
I am a newbie to Autolisp, so please forgive
me for the very basic question. I have created several lisp files for AutoCAD
2008 which reside in the acad.lsp file. They all work perfectly this way. The
problem comes when I try to write a lisp file to combine some of these routines.
It just tells me "Command Unknown" and moves on to the next part of the lisp.
Does anyone know what is going on and how to fix it?
Message 8 of 12
Anonymous
in reply to: Anonymous

Not sure that I understand... You are saying that I need to show it like:

c:(defun command name ()

I also see that you are saying that this will make it only work with the new lisp I am creating. I need it to work solo and with the new routine.
Message 9 of 12
Anonymous
in reply to: Anonymous

THANKS Kent!!!!!!! You just ended a week long battle to make this thing work. It now works like a charm!

Thanks again!

Dustin Edited by: springinlizard on Oct 15, 2008 11:32 AM
Message 10 of 12
Anonymous
in reply to: Anonymous


Pay it forward....  That's something I learned
from watching this Newsgroup -- I'm not even sure where you would find it in
Help, if it's there at all.

--
Kent Cooper

 

 

springinlizard wrote...
THANKS Kent!!!!!!! You just ended a week long
battle to make this thing work. It now works like a charm! Thanks again!
Dustin
Message 11 of 12
scot-65
in reply to: Anonymous

ACADLSPASDOC = 1
Loads ACAD.lsp every time (overtakes LISPINIT).


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 12 of 12
scot-65
in reply to: Anonymous

ACADLSPASDOC = 1
Loads ACAD.lsp every time (overtakes LISPINIT).


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


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

Post to forums  

Autodesk Design & Make Report

”Boost