Gary McMaster a écrit :
> The "right way" part is often a matter of opinion ...
The "right way" is when it doesn't crash when I print from a sheetset 🙂
> If you have a project named "Acad.dvb" in your Acad search path, it will be
> automatically loaded at the start of a session.
>
> If the above is true and the project contains a sub named "AcadStartup",
> that sub will execute automatically on startup.
>
> From help: (search for "acad.dvb")
>
> If you want a macro in your acad.dvb file to run each time you start a new
> drawing or open an existing one, add the following code to your acaddoc.lsp
> file:
> (defun S::STARTUP()(command "_-vbarun" "updatetitleblock"))The project name
> in the example is updatetitleblock.
In fact, I already had an APPLOADed central LISP file which contained this :
(command "_-vbarun" "MyRoutine.dvb!ThisDrawing.MyRoutine")
I started trying to use what you told me (acad.dvb), and, in the process, I
discovered that there are V-lisp functions named (vl-vbaload) and (vl-vbarun).
(vl-vbaload), for some unknown reason, fail with an "automation error" message
(that stuff is so ligthly documented, I have no idea what's happening)
(vl-vbarun "MyRoutine.dvb!ThisDrawing.MyRoutine"), however, works perfectly,
and I no longer encounter these dreaded crashes. I guess that the V-Lisp
functions have a better handling of already-loaded dvb files.
Thanks for the hints, anyway.
Fabien.