About acaddos.lsp

About acaddos.lsp

Anonymous
Not applicable
400 Views
5 Replies
Message 1 of 6

About acaddos.lsp

Anonymous
Not applicable
Hi!
I want a .dvb project to be loaded every time I open the Autocad.
I want the file to be loaded only one time at a session and not at each
drawing!
I edit acad2000doc.lsp file and I put at the end:

defun-q MyStartUp( )
(command "_-VBALOAD" "MyDVBFile.dvb")
(princ())
)
(setq S::STARTUP (append S::STARTUP MyStartUp))

Unfortunatelly every time I open a new drawing it displays a message
that the file has been already been open.
Any idea how can I face the problem?
I thought I should try to handle the error,but I am not so good with
AutoLisp!

Thanks.
0 Likes
401 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Hi,

add your load to the ACAD2000.LSP file. This from said file:

This file is normally loaded only once per AutoCAD session. If you wish to
have LISP code loaded into every document, you should add your code to
acaddoc.lsp

/Petri
.
"J.K." wrote in message
news:F1F3037FFFDAD4768270ADF099F4DCB1@in.WebX.maYIadrTaRb...
> Hi!
> I want a .dvb project to be loaded every time I open the Autocad.
> I want the file to be loaded only one time at a session and not at each
> drawing!
> I edit acad2000doc.lsp file and I put at the end:
>
> defun-q MyStartUp( )
> (command "_-VBALOAD" "MyDVBFile.dvb")
> (princ())
> )
> (setq S::STARTUP (append S::STARTUP MyStartUp))
>
> Unfortunatelly every time I open a new drawing it displays a message
> that the file has been already been open.
> Any idea how can I face the problem?
> I thought I should try to handle the error,but I am not so good with
> AutoLisp!
>
> Thanks.
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks for the answer.
I did it but every time I open a drawing a msg tells me that the file has
already been loaded!?

"J.K." wrote in message
news:F1F3037FFFDAD4768270ADF099F4DCB1@in.WebX.maYIadrTaRb...
> Hi!
> I want a .dvb project to be loaded every time I open the Autocad.
> I want the file to be loaded only one time at a session and not at each
> drawing!
> I edit acad2000doc.lsp file and I put at the end:
>
> defun-q MyStartUp( )
> (command "_-VBALOAD" "MyDVBFile.dvb")
> (princ())
> )
> (setq S::STARTUP (append S::STARTUP MyStartUp))
>
> Unfortunatelly every time I open a new drawing it displays a message
> that the file has been already been open.
> Any idea how can I face the problem?
> I thought I should try to handle the error,but I am not so good with
> AutoLisp!
>
> Thanks.
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
load from acad.dvb
"J.K." wrote in message
news:F1F3037FFFDAD4768270ADF099F4DCB1@in.WebX.maYIadrTaRb...
> Hi!
> I want a .dvb project to be loaded every time I open the Autocad.
> I want the file to be loaded only one time at a session and not at each
> drawing!
> I edit acad2000doc.lsp file and I put at the end:
>
> defun-q MyStartUp( )
> (command "_-VBALOAD" "MyDVBFile.dvb")
> (princ())
> )
> (setq S::STARTUP (append S::STARTUP MyStartUp))
>
> Unfortunatelly every time I open a new drawing it displays a message
> that the file has been already been open.
> Any idea how can I face the problem?
> I thought I should try to handle the error,but I am not so good with
> AutoLisp!
>
> Thanks.
>
>
0 Likes
Message 5 of 6

Anonymous
Not applicable
Create a acad.lsp file, say by copying the acaddoc.lsp file and deleting the contents (you won't find it, you have to create it), making sure this is somewhere in the autocad search path, add your loading code for the vba routine into it, then also add the following statement into the acad.lsp file, which sets the ACADLSPASDOC variable so that acad.lsp runs only in the first drawing opened.
(setvar "acadlspasdoc" 0)

This way your VBA code will be loaded up only the once.
0 Likes
Message 6 of 6

Anonymous
Not applicable
It is loading in each drawing because you are using the S::StartUp routine.
Perform the load _by itself_ in the Acad.lsp to achieve your desired result.

There was a thread ("Automatically running a vba project") about 2 months
ago that discussed this, with some interesting associated problems (related
to multiple documents). I made a reply in that thread that discussed how to
make your approach work with multiple documents, and alternatives where
discussed.

--
R. Robert Bell, MCSE
www.AcadX.com


"J.K." wrote in message
news:F1F3037FFFDAD4768270ADF099F4DCB1@in.WebX.maYIadrTaRb...
| Hi!
| I want a .dvb project to be loaded every time I open the Autocad.
| I want the file to be loaded only one time at a session and not at each
| drawing!
| I edit acad2000doc.lsp file and I put at the end:
|
| defun-q MyStartUp( )
| (command "_-VBALOAD" "MyDVBFile.dvb")
| (princ())
| )
| (setq S::STARTUP (append S::STARTUP MyStartUp))
|
| Unfortunatelly every time I open a new drawing it displays a message
| that the file has been already been open.
| Any idea how can I face the problem?
| I thought I should try to handle the error,but I am not so good with
| AutoLisp!
|
| Thanks.
|
|
0 Likes