load lisp automaticaly

New to IntelliCAD? Get started here with basic questions and answers.

Moderators: CMS Inc, avaernes

Post Reply
phenom
Newbie
Posts: 2
Joined: Tue Dec 07, 2010 8:46 pm

load lisp automaticaly

Post by phenom » Wed Dec 08, 2010 4:33 pm

ive been reading the help on icad6.6pro and cant seem to get a areap.lisp to load automatically when i start the program, can some one help with this.
thank you
Dave
JCAMPOS

Post by JCAMPOS » Thu Dec 09, 2010 3:45 am

Hi,

In order to load LISP files at program's initialization, you need to create an icad.lsp file and put there your load functions, such as the following:

Code: Select all

(load "C:\\CompletePath\\LispFile.lsp")
Put the icad.lsp file in the program's execution folder and, the next time you start the program, your routines will be loaded automatically.

Regards,
JCAMPOS
phenom
Newbie
Posts: 2
Joined: Tue Dec 07, 2010 8:46 pm

Post by phenom » Thu Dec 09, 2010 9:04 pm

Great thank you

took a little playing around

(load "C:\\Program Files\\CMS\\IntelliCAD 6.6 Professional\\areap.lsp")
i needed double backslashes.
thanks again
Dave
Userlevel6
Valued Contributor
Posts: 31
Joined: Tue Sep 18, 2012 11:44 am

autoloading LISP routines

Post by Userlevel6 » Thu Sep 20, 2012 3:07 pm

Although this is an old thread, I have a little something to add...

Follow the ACAD convention. Make an ICAD.LSP, as well as an ICADDOC.LSP.

The ICAD.LSP, if it's on your search path, will load when ICAD.exe starts up, followed by ICADDOC.LSP.

If you do not close ICAD.exe and then open another drawing, you'll find that ICADDOC.LSP loads, but ICAD.LSP does not. This is by design.

Personally, I use something like this...
(delay command is to allow time for ICAD to load before processing a script called from command line using /b flag.)
ICAD.LSP:
(setq 1strun "yes")
(command "delay" 1000) ; note delay for startup scripts

ICADDOC.LSP:
(if (eq 1strun "yes")
(setq 1strun nil)
(progn ;load these only if this is not the startup drawing!
(load "NILERASE") ; erase empty text entites
(load "TITLEBLOCK_DETECT") ; display titleblock size-orientation
(princ "...done auto-loading LISP routines.")
)
) ;end if
;; Silent load.
(princ)

This is just a sample; the files NILERASE and TITLEBLOCK_DETECT are my own creations.
User avatar
CMS Inc
Site Admin
Posts: 105
Joined: Wed Feb 23, 2005 12:01 am
Location: Burleson, TX
Contact:

Re: load lisp automaticaly

Post by CMS Inc » Wed Oct 09, 2019 10:05 am

On CMS intelliCAD 9.x you can use icaddoc.lsp for that purpose instead of icad.lsp.
icaddoc.lsp is loaded with every new drawing created or opened.

Another possible option is to set LISPINIT system variable to 2. In this case all drawings will share the same LISP environment (variables, functions etc).
Post Reply