Author Topic: acaddoc.lsp  (Read 2419 times)

0 Members and 1 Guest are viewing this topic.

ROBBO

  • Bull Frog
  • Posts: 217
acaddoc.lsp
« on: March 07, 2014, 10:07:57 AM »
Hello,

I have a acaddoc.lsp to load and autoload various lisp routines and commands on AutoCAD start-up. There is one particular routine I would like to Load in after all other routines and commands have loaded from the acaddoc.lsp .

Any help on how I can achieve this would be much appreciated.

Many thanks in advance, Robbo.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

alanjt

  • Needs a day job
  • Posts: 5353
  • Standby for witty remark...
Re: acaddoc.lsp
« Reply #1 on: March 07, 2014, 10:11:59 AM »
Put its loading sequence at the bottom of the acaddoc file.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

ROBBO

  • Bull Frog
  • Posts: 217
Re: acaddoc.lsp
« Reply #2 on: March 07, 2014, 10:21:55 AM »
Thank you alanjt for your prompt reply. I tried this, but didn't appear to work. The particular routine in question appears to load again once another routine is loaded from a custom dll on start-up.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

Lee Mac

  • Seagull
  • Posts: 12937
  • London, England
Re: acaddoc.lsp
« Reply #3 on: March 08, 2014, 09:58:26 AM »
There is one particular routine I would like to Load in after all other routines and commands have loaded from the acaddoc.lsp

Load the program using the s::startup function - this is a 'post-initialisation' funciton which is evaluated after all other drawing startup processes.

Here is an example of a wrapper for the load function to enable you to define a post-initialisation load call:
Code: [Select]
(defun post-load ( lsp )
    (if (findfile lsp)
        (if (= 'list (type s::startup))
            (if (not (member (list 'load lsp 'nil) s::startup))
                (setq s::startup (append s::startup (list (list 'load lsp 'nil))))
            )
            (eval (list 'defun-q 's::startup 'nil (list 'load lsp 'nil) '(princ)))
        )
        (prompt (strcat "\n\"" lsp "\" not found."))
    )
)
Add an expression to your acaddoc.lsp with the filename of the program to load, e.g.:
Code: [Select]
(post-load "mylisp.lsp")

ROBBO

  • Bull Frog
  • Posts: 217
Re: acaddoc.lsp
« Reply #4 on: March 10, 2014, 03:01:54 AM »
Excellent! Thank you Lee for your responce. This solved my problem and routines now load (once) in the correct order as listed in my acaddoc.lsp. :kewl:

Cheers, Robbo.
« Last Edit: March 10, 2014, 07:30:31 AM by ROBBO »
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

Lee Mac

  • Seagull
  • Posts: 12937
  • London, England
Re: acaddoc.lsp
« Reply #5 on: March 10, 2014, 06:40:29 PM »
Excellent to hear Robbo - you're most welcome!  :-)