Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
518 Posts
19 Kudos
Registered: ‎07-05-2010
Post 1 of 11
Accepted Solution

Lisp in Startup Suite will not work

594 Views, 10 Replies
12-12-2012 02:30 PM

I have loaded a simple lisp in my startup suite which refuses to load.

 

I have to reload each time.

 

Other lisp files in my startup suite work fine and I do not have to reload each time.

Separate acaddoc.lsp sounds like a good strategy.

I'll do that. Easy for other users as well.

 

Thx

Using autoload is also a good suggestion.

Thanks

*Expert Elite*
3,593 Posts
550 Kudos
Registered: ‎12-17-2004
Post 2 of 11

Re: Lisp in Startup Suite will not work

12-12-2012 03:35 PM in reply to: leothebuilder

leothebuilder,

perhaps there is another lisp with a command (defun) with the same name, and the first to be load stops working when the second is loaded.

Try to change the lisp command that is not loading to another command name.

 

Henrique

*Expert Elite*
518 Posts
19 Kudos
Registered: ‎07-05-2010
Post 3 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 05:19 AM in reply to: leothebuilder

Thanks for the suggestion, but that's not the problem. They all have distinct command names.

Weird thing is, if I append the lisp to another lisp file that has a series of routines, they work fine being in the Startup Suite.

Distinguished Contributor
103 Posts
5 Kudos
Registered: ‎10-23-2003
Post 4 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 10:54 AM in reply to: leothebuilder

I recommend skipping the startup suite.  Use your acaddoc.lsp and just add a line for each routine that you want loaded.  Where Lisp Name is use the name of your lisp.  The startup suite gave us headaches in the past, and once I replaced it with lines in acaddoc.lsp the issues went away.

 

(load "Lisp Name")

 

 

*Expert Elite*
518 Posts
19 Kudos
Registered: ‎07-05-2010
Post 5 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 11:42 AM in reply to: leothebuilder

I did add that line to my acad2012doc.lsp and that works great (have to add the folder where lisp is located to the search path)

Distinguished Contributor
103 Posts
5 Kudos
Registered: ‎10-23-2003
Post 6 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 12:24 PM in reply to: leothebuilder

Modifiying the acad2012doc.lsp isn't recommended.  That file will go away when you upgrade, and it's full of stuff that AutoCAD needs.

 

A better way is to make a separate file just called acaddoc.lsp that contains customization items.  System variable settings, load lisp routines, etc.  Keep that file in a place where you and your other users can access it.  Make sure that location is at or near the top of your support file search paths.  I keep out company acaddoc.lsp read only to other users, and if they find something that they would like added or changed (and nobody objects) I take care of it and that way everyone is working from the same basic settings.

*Expert Elite*
3,593 Posts
550 Kudos
Registered: ‎12-17-2004
Post 7 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 12:30 PM in reply to: leothebuilder

leothebuilder:

if you start to use acaddoc.lisp to load the lisp files, think of using the (autoload) function.

Only loads the lisp file if necessary, only if you enter de command in the command line, the lisp file will be loaded, not using memory unnecessarily.

 

(autoload "yourdrive:/yourpath/yourlisp.lsp" '("yourcommand"))

 

or if tour lisp file is on a support file search path just:

 

(autoload "yourlispfile" '("yourcommand" "yourcommand1"))

 

notice that the commands are in a list if the file has more than one command defined.

 

hope that helps

Henrique

*Expert Elite*
518 Posts
19 Kudos
Registered: ‎07-05-2010
Post 8 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 02:59 PM in reply to: leothebuilder

Separate acaddoc.lsp sounds like a good strategy.

I'll do that. Easy for other users as well.

 

Thx

*Expert Elite*
518 Posts
19 Kudos
Registered: ‎07-05-2010
Post 9 of 11

Re: Lisp in Startup Suite will not work

12-13-2012 03:01 PM in reply to: hmsilva

Using autoload is also a good suggestion.

Thanks

New Member
1 Posts
0 Kudos
Registered: ‎05-22-2014
Post 10 of 11

Re: Lisp in Startup Suite will not work

12-16-2014 01:49 PM in reply to: leothebuilder

I think this might have to do with the Windows Update that just came through on December 10th or 11th.  The ability to Auto load lisp stopped for me directly after the update.  I am looking right now to see which of the list of updates is the culprit.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!