Cheers Ken, I missed that subtle difference. It's not something I know much
about. That said, the first CAD programming I did was autolisp 22 years ago,
and not used it much since so a bit rusty now!
Dave
"Ken Krupa" wrote in message
news:5816824@discussion.autodesk.com...
You need to used defun-q for your s::startup too. This will allow the append
to work.
Dave Preston wrote:
> Hmm. Although everything works perfectly I have just noticed that I get
> the
> following error when starting AutoCAD if the acaddoc.lsp is present:-
>
> AutoCAD menu utilities loaded.; error: Invalid attempt to access a
> compiled
> function definition. You may want to define it using defun-q: #
> @0f40ee38
> S::STARTUP>
>
>
> My acad.lsp contains the following:-
> (defun S::STARTUP()
> (command "_-vbaload" "StoreSpace.dvb")
> (command "_-VBARUN" "Initialise")
> )
>
> My acaddoc.lsp contains the following:-
> (defun-q docStartup()
> (command "-VBARUN" "Runsynchronise")
> )
> (setq S::STARTUP (append S::STARTUP docStartup))
>
> "R.K. McSwain" wrote in message
> news:5813787@discussion.autodesk.com...
> Dave Preston wrote:
>> I have a desktop icon which starts AutoCAD in a directory with the
>> following
>> 2 files:-
>>
>> acad.lsp which contains the following
>>
>> (defun S::STARTUP()
>> (command "_-vbaload" "StoreSpace.dvb")
>> (command "_-VBARUN" "Initialise")
>> )
>>
>> and acaddoc.lsp which contains the following:-
>> (defun S::STARTUP()
>> (command "_-VBARUN" "Runsynchronise")
>> )
>>
>
> Your "S::STARTUP" function in "acaddoc.lsp" is overwriting
> the same function as defined in "acad.lsp"
>
> "Acad.lsp" loads first, defining S::STARTUP.
> Then "acaddoc.lsp" loads, redefining S::STARTUP.
>
> Put all your startup code in a function called "mystartup",
> (in "acaddoc.lsp") and append it to S::Startup, in case it's
> already defined somewhere else...
>
> (defun-q mystartup ()
> (this is my startup code)
> )
> (setq S::STARTUP (append S::STARTUP mystartup))
>
>
>
>
>
>
>