Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Member
BBakerGT
Posts: 3
Registered: ‎08-08-2012
Message 1 of 6 (3,347 Views)
Accepted Solution

Autocad 2013 doesn't recognize my lisp commands

3347 Views, 5 Replies
08-08-2012 03:11 PM

I have writted a set of lisp routines with dcl files that I have implemented in most versions of Autocad since release 14. I can install the toolbars in Autocad 2013 but when I try to execute on of the commands, either by toolbar icon or command line, I get the message "Unknown Command".

 

I have added the appropriate paths to path list.

 

Dell Precision M4400 Laptop

Vista Business

ADN Support Specialist
wayne.brill
Posts: 187
Registered: ‎08-25-2004
Message 2 of 6 (3,345 Views)

Re: Autocad 2013 doesn't recognize my lisp commands

08-08-2012 04:06 PM in reply to: BBakerGT

Hi,

 

From your description I would guess that the lisp functions have not been loaded in the drawing. What happens if you try to run the function defined as a command from the command line?

(c:myfunction)

 

If you can't get this resolved, can you provide a small example that I can use to recreate the behavior?



Wayne Brill
Developer Technical Services
Autodesk Developer Network

Member
BBakerGT
Posts: 3
Registered: ‎08-08-2012
Message 3 of 6 (3,337 Views)

Re: Autocad 2013 doesn't recognize my lisp commands

08-08-2012 05:58 PM in reply to: BBakerGT

Hi Wayne,

 

I have 23 commands defined in Acad.lsp. These commands load and execute functions in 14 lisp files with 13 dcl files. An example of a command definition inAcad.lisp is as follows:

 

(defun C:BITDESIGN ()

    (if (/= 1 (boole 1 1 (getvar "USERI1)))

        (load "ddesign.lsp")

    )

    (bdesign)

)

 

The second line checks user variable USERI1 to see if "ddesign.lsp is already loaded; if not it is loaded.

bdesign is the routine executed in ddesign.lsp.

 

I have run the BITDESIGN command from its icon in a toolbar and from the command line. In each case I get the message "Unknown command "BITDESIGN".

 

This indicates that ACAD.LSP is not being loaded. I have added the proper path in "Tools/Options/Files". I have placed ACAD.LSP in the AutoCAD 2013/Support folder and in the AutoCAD/UserDataCache/Support folder. Is there another folder that I need to copy my acad.lsp folder to?. I have also checked the "Load Acad.lsp with each drawing" in the Tools/Options dialog.

 

Thanks,

Bill

Valued Contributor
Rick-K
Posts: 85
Registered: ‎07-25-2012
Message 4 of 6 (3,314 Views)

Re: Autocad 2013 doesn't recognize my lisp commands

08-09-2012 07:22 AM in reply to: BBakerGT

Search your computer for all "Acad.lsp" files, autocad will load the first one it finds. It is probably finding one you are not aware of.

 

Since everything is loaded in the acad.lsp I would try placing an alert box line in the acad.lsp to see if it is loading.

Perhaps right before your first Defun.

 

(alert "its loading")

 

This way you know that it is indeed loading your acad.lsp.

 

Rick

*Expert Elite*
scot-65
Posts: 2,125
Registered: ‎12-11-2003
Message 5 of 6 (3,304 Views)

Re: Autocad 2013 doesn't recognize my lisp commands

08-09-2012 03:37 PM in reply to: BBakerGT

BBakerGT wrote: 

>> This indicates that ACAD.LSP is not being loaded.

Thanks,

Bill


 

Possible fixes:

 

(findfile "ACAD.LSP")

Is there a path?

 

Check to see if ACADLSPASDOC and LISPINIT are set to 1.

An alternative is to rename the file to ACADDOC.LSP.

 

???

 

Scot-65
Dyslexia is a permanent physical disability that cannot be seen.
Member
BBakerGT
Posts: 3
Registered: ‎08-08-2012
Message 6 of 6 (3,270 Views)

Re: Autocad 2013 doesn't recognize my lisp commands

08-10-2012 01:21 PM in reply to: BBakerGT

Thanks Rick-K,

 

Sure enough there was another acad.lsp in the acadm folder. I appended my acad.lsp to that one and everything is working.

 

I have another situation but not really a problem. When I tried to install my lisp programs using a legacy .cui file, AutoCad wouldn't let me save the new .cuix file and the installation failed. I was logged on as myself (with administrator privileges). When I logged on as administrator, I had no problem with the installation. It's not really a problem since I can log on as administrator, but I was curious why it didn't work. Is this likely a Windows Vista problem rather than an AutoCad problem?

 

Bill

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community