Page 1 of 1

load lisp automaticaly

Posted: Wed Dec 08, 2010 4:33 pm
by phenom
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

Posted: Thu Dec 09, 2010 3:45 am
by JCAMPOS
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

Posted: Thu Dec 09, 2010 9:04 pm
by phenom
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

autoloading LISP routines

Posted: Thu Sep 20, 2012 3:07 pm
by Userlevel6
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.

Re: load lisp automaticaly

Posted: Wed Oct 09, 2019 10:05 am
by CMS Inc
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).