executing code at runtime?

executing code at runtime?

Anonymous
Not applicable
183 Views
2 Replies
Message 1 of 3

executing code at runtime?

Anonymous
Not applicable
how do i setup a vba project to execute code when it is loaded?
i've tried using the AutoCADObjects > AcadDocument_Activate() event to
trigger my startup macro.
this works if my project is already loaded when i open a dwg. but the
initial application start and first dwg open does not trigger this event?
0 Likes
184 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Embedd the macro in the template used to create the
drawing file.

"Corey A. Layton" wrote:
>
> how do i setup a vba project to execute code when it is loaded?
> i've tried using the AutoCADObjects > AcadDocument_Activate() event to
> trigger my startup macro.
> this works if my project is already loaded when i open a dwg. but the
> initial application start and first dwg open does not trigger this event?

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://www.caddzone.com */
/*********************************************************/
0 Likes
Message 3 of 3

Anonymous
Not applicable
yes, that is a solution, for newly created dwgs.
but what if the first dwg i open is pre-existing?
i thought that i might use a lisp file (*.mnl actually) to call the startup
macro intead of using the AcadDocument_Activate() event in vba. that way the
code will run when each dwg is opened (as long as the menu is loaded)

Tony Tanzillo wrote in message
news:[email protected]...
> Embedd the macro in the template used to create the
> drawing file.
>
> "Corey A. Layton" wrote:
> >
> > how do i setup a vba project to execute code when it is loaded?
> > i've tried using the AutoCADObjects > AcadDocument_Activate() event to
> > trigger my startup macro.
> > this works if my project is already loaded when i open a dwg. but the
> > initial application start and first dwg open does not trigger this
event?
>
> --
> /*********************************************************/
> /* Tony Tanzillo Design Automation Consulting */
> /* Programming & Customization for AutoCAD & Compatibles */
> /* ----------------------------------------------------- */
> /* [email protected] */
> /* http://www.caddzone.com */
> /*********************************************************/
0 Likes