#2
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

#3
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

#4
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

#5
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).
cron