Automatic Macro Running

Automatic Macro Running

Anonymous
Not applicable
925 Views
17 Replies
Message 1 of 18

Automatic Macro Running

Anonymous
Not applicable
Hi all

 

I'm still looking for a solution, and I'm sure
it's there.

 

Is there any method of running a macro
automatically when I save a file?

 

Thanks

 

Rui

 

 
0 Likes
926 Views
17 Replies
Replies (17)
Message 2 of 18

Anonymous
Not applicable
Yes, you should use
the AutoSave:

 

This code should be add into the "Autodesk
Inventor Objects\ThisDocument" section.

 

 

Public Sub AutoSave_DoNothing()

    MsgBox "This macro do...
nothing"
End Sub

The message will be prompt each time you save the
file (replace the "DoNothig" with your function name).

 

Xavier


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi all

 

I'm still looking for a solution, and I'm sure
it's there.

 

Is there any method of running a macro
automatically when I save a file?

 

Thanks

 

Rui

 

 
0 Likes
Message 3 of 18

Anonymous
Not applicable
Excellent!! Thanks

 

Now for making my program better:

 

1. Can I add this to a template file so it's
available to all parts?

 

2. Can something similar be done so the program
runs when I commit a feature?

 

Thanks for the help so far.

 

Rui

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Yes, you should
use the AutoSave:

 

This code should be add into the "Autodesk
Inventor Objects\ThisDocument" section.

 

 

Public Sub AutoSave_DoNothing()

    MsgBox "This macro do...
nothing"
End Sub

The message will be prompt each time you save the
file (replace the "DoNothig" with your function name).

 

Xavier


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi all

 

I'm still looking for a solution, and I'm sure
it's there.

 

Is there any method of running a macro
automatically when I save a file?

 

Thanks

 

Rui

 


size=2>
 
0 Likes
Message 4 of 18

Anonymous
Not applicable
Ruif

You may want to read the Subject VBA creation started on the 18th of this month. Using
the Auto macros in your templates is not suggested. Also read the subject "A limit to
the # of VBA project loaded at one time?" thread started on the 16th

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"RuiF" wrote in message
news:D2BA59B40BDB3BD6C3A7063FBBAF1B30@in.WebX.maYIadrTaRb...
> Excellent!! Thanks
>
> Now for making my program better:
>
> 1. Can I add this to a template file so it's available to all parts?
>
> 2. Can something similar be done so the program runs when I commit a feature?
>
> Thanks for the help so far.
>
> Rui
>
> "Xavier Collet" wrote in message
news:8244FAFC61BED280D94AFFCBF2D04838@in.WebX.maYIadrTaRb...
> Yes, you should use the AutoSave:
>
> This code should be add into the "Autodesk Inventor Objects\ThisDocument" section.
>
>
> Public Sub AutoSave_DoNothing()
> MsgBox "This macro do... nothing"
> End Sub
>
> The message will be prompt each time you save the file (replace the "DoNothig" with
your function name).
>
> Xavier
> "RuF" a écrit dans le message de
news:149D88C0BC9E882FB314B8249580AA23@in.WebX.maYIadrTaRb...
> Hi all
>
> I'm still looking for a solution, and I'm sure it's there.
>
> Is there any method of running a macro automatically when I save a file?
>
> Thanks
>
> Rui
>
>
0 Likes
Message 5 of 18

Anonymous
Not applicable
Those are some of the reasons why I wanted to keep
this as an application macro.

 

Is there any way for a document macro to call an
application program to run?

 

At least then the document would contain very
little code.

 

Like I said, ideally, I would have an application
macro that ran every time a feature in a part was commited, but so far nobody
has been able to help me (added to the fact that I'm relatively new to IV and
VBA, the scenario doesn't get better).

 

I've been looking at transactions, although I'm
not sure if that's what I want.

 

Thanks in advance for any input you guys may
have.

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Ruif

You
may want to read the Subject VBA creation started on the 18th of this
month.  Using
the Auto macros in your templates is not
suggested.   Also read the subject "A limit to
the # of VBA
project loaded at one time?" thread started on the
16th

--
Kent
Assistant Moderator
Autodesk Discussion Forum
Moderator Program


"RuiF" <
href="mailto:rui.cad@netcabo.pt">rui.cad@netcabo.pt
> wrote in
message

href="news:D2BA59B40BDB3BD6C3A7063FBBAF1B30@in.WebX.maYIadrTaRb">news:D2BA59B40BDB3BD6C3A7063FBBA...
...
>
Excellent!! Thanks
>
> Now for making my program
better:
>
> 1. Can I add this to a template file so it's available
to all parts?
>
> 2. Can something similar be done so the program
runs when I commit a feature?
>
> Thanks for the help so
far.
>
> Rui
>
>   "Xavier Collet" <
href="mailto:xcollet@hurni.ch">xcollet@hurni.ch
> wrote in message

href="news:8244FAFC61BED280D94AFFCBF2D04838@in.WebX.maYIadrTaRb">news:8244FAFC61BED280D94AFFCBF2D...
...
>  
Yes, you should use the AutoSave:
>
>   This code should
be add into the "Autodesk Inventor Objects\ThisDocument"
section.
>
>
>   Public Sub
AutoSave_DoNothing()
>       MsgBox "This
macro do... nothing"
>   End Sub
>
>  
The message will be prompt each time you save the file (replace the "DoNothig"
with
your function name).
>
>  
Xavier
>     "RuF" <
href="mailto:rui.cad@netcabo.pt">rui.cad@netcabo.pt
> a écrit dans le
message de

href="news:149D88C0BC9E882FB314B8249580AA23@in.WebX.maYIadrTaRb">news:149D88C0BC9E882FB314B824958...
...
>    
Hi all
>
>     I'm still looking for a
solution, and I'm sure it's there.
>
>     Is
there any method of running a macro automatically when I save a
file?
>
>    
Thanks
>
>    
Rui
>
>

0 Likes
Message 6 of 18

Anonymous
Not applicable
In that thread I pointed you to Brian had posted a solution. Someone had a bit of a
problem with it so he said he was looking into improving the code as I remember. Might
want to reread the thread.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"RuiF" wrote in message
news:14D83A200187C47B4409DB1B0215BDA9@in.WebX.maYIadrTaRb...
> Those are some of the reasons why I wanted to keep this as an application macro.
>
> Is there any way for a document macro to call an application program to run?
>
0 Likes
Message 7 of 18

Anonymous
Not applicable
Thanks Kent

 

Hadn't seen the post in iCF.  Going to look
at that.

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
In
that thread I pointed you to Brian had posted a solution.  Someone had a
bit of a
problem with it so he said he was looking into improving the code
as I remember.  Might
want to reread the
thread.

--
Kent
Assistant Moderator
Autodesk Discussion Forum
Moderator Program


"RuiF" <
href="mailto:rui.cad@netcabo.pt">rui.cad@netcabo.pt
> wrote in
message

href="news:14D83A200187C47B4409DB1B0215BDA9@in.WebX.maYIadrTaRb">news:14D83A200187C47B4409DB1B021...
...
>
Those are some of the reasons why I wanted to keep this as an application
macro.
>
> Is there any way for a document macro to call an
application program to run?
>

0 Likes
Message 8 of 18

Anonymous
Not applicable
I wouldn't even recommend that.

 

I had a few hundred parts with nothing but a small
sub (3-4 lines) and it kept crashing VBA.  Inventor was fine but the VBA
environment couldn't handle it.

 

I'd look at making it an add-in. (which is what I
ended up doing with my document code)

 


--
Sean Dotson, PE

href="http://www.sdotson.com">http://www.sdotson.com

Check the Inventor
FAQ for most common questions

href="http://www.sdotson.com/faq.html">www.sdotson.com/faq.html

-----------------------------------------------------------------------


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Those are some of the reasons why I wanted to
keep this as an application macro.

 

Is there any way for a document macro to call an
application program to run?

 

At least then the document would contain very
little code.

 

Like I said, ideally, I would have an
application macro that ran every time a feature in a part was commited, but so
far nobody has been able to help me (added to the fact that I'm relatively new
to IV and VBA, the scenario doesn't get better).

 

I've been looking at transactions, although I'm
not sure if that's what I want.

 

Thanks in advance for any input you guys may
have.

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Ruif

You
may want to read the Subject VBA creation started on the 18th of this
month.  Using
the Auto macros in your templates is not
suggested.   Also read the subject "A limit to
the # of VBA
project loaded at one time?" thread started on the
16th

--
Kent
Assistant Moderator
Autodesk Discussion Forum
Moderator Program


"RuiF" <
href="mailto:rui.cad@netcabo.pt">rui.cad@netcabo.pt
> wrote in
message

href="news:D2BA59B40BDB3BD6C3A7063FBBAF1B30@in.WebX.maYIadrTaRb">news:D2BA59B40BDB3BD6C3A7063FB...
...
>
Excellent!! Thanks
>
> Now for making my program
better:
>
> 1. Can I add this to a template file so it's
available to all parts?
>
> 2. Can something similar be done so
the program runs when I commit a feature?
>
> Thanks for the
help so far.
>
> Rui
>
>   "Xavier Collet"
<xcollet@hurni.ch> wrote in
message

href="news:8244FAFC61BED280D94AFFCBF2D04838@in.WebX.maYIadrTaRb">news:8244FAFC61BED280D94AFFCBF...
...
>  
Yes, you should use the AutoSave:
>
>   This code
should be add into the "Autodesk Inventor Objects\ThisDocument"
section.
>
>
>   Public Sub
AutoSave_DoNothing()
>       MsgBox
"This macro do... nothing"
>   End
Sub
>
>   The message will be prompt each time you
save the file (replace the "DoNothig" with
your function
name).
>
>   Xavier
>    
"RuF" <rui.cad@netcabo.pt> a
écrit dans le message de

href="news:149D88C0BC9E882FB314B8249580AA23@in.WebX.maYIadrTaRb">news:149D88C0BC9E882FB314B8249...
...
>    
Hi all
>
>     I'm still looking for a
solution, and I'm sure it's there.
>
>    
Is there any method of running a macro automatically when I save a
file?
>
>    
Thanks
>
>    
Rui
>
>

0 Likes
Message 9 of 18

Anonymous
Not applicable
I just posted an update of the utility in customer
files.

 

-Brian


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Thanks Kent

 

Hadn't seen the post in iCF.  Going to look
at that.

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
In
that thread I pointed you to Brian had posted a solution.  Someone had
a bit of a
problem with it so he said he was looking into improving the
code as I remember.  Might
want to reread the
thread.

--
Kent
Assistant Moderator
Autodesk Discussion
Forum Moderator Program


"RuiF" <
href="mailto:rui.cad@netcabo.pt">rui.cad@netcabo.pt
> wrote in
message

href="news:14D83A200187C47B4409DB1B0215BDA9@in.WebX.maYIadrTaRb">news:14D83A200187C47B4409DB1B0...
...
>
Those are some of the reasons why I wanted to keep this as an application
macro.
>
> Is there any way for a document macro to call an
application program to
run?
>

0 Likes
Message 10 of 18

Anonymous
Not applicable
Not that I'm 100% sure of what an addin is
exactly, but I'm almost sure you can't do it with VBA can you?

 

Rui


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I wouldn't even recommend that.

 

I had a few hundred parts with nothing but a
small sub (3-4 lines) and it kept crashing VBA.  Inventor was fine but
the VBA environment couldn't handle it.

 

I'd look at making it an add-in. (which is what I
ended up doing with my document code)

 


--
Sean Dotson, PE

href="http://www.sdotson.com">http://www.sdotson.com

Check the Inventor
FAQ for most common questions

href="http://www.sdotson.com/faq.html">www.sdotson.com/faq.html

-----------------------------------------------------------------------


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Those are some of the reasons why I wanted to
keep this as an application macro.

 

Is there any way for a document macro to call
an application program to run?

 

At least then the document would contain very
little code.

 

Like I said, ideally, I would have an
application macro that ran every time a feature in a part was commited, but
so far nobody has been able to help me (added to the fact that I'm
relatively new to IV and VBA, the scenario doesn't get better).

 

I've been looking at transactions, although
I'm not sure if that's what I want.

 

Thanks in advance for any input you guys may
have.

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Ruif

You
may want to read the Subject VBA creation started on the 18th of this
month.  Using
the Auto macros in your templates is not
suggested.   Also read the subject "A limit to
the # of VBA
project loaded at one time?" thread started on the
16th

--
Kent
Assistant Moderator
Autodesk Discussion Forum
Moderator Program


"RuiF" <
href="mailto:rui.cad@netcabo.pt">rui.cad@netcabo.pt
> wrote in
message

href="news:D2BA59B40BDB3BD6C3A7063FBBAF1B30@in.WebX.maYIadrTaRb">news:D2BA59B40BDB3BD6C3A7063...
...
>
Excellent!! Thanks
>
> Now for making my program
better:
>
> 1. Can I add this to a template file so it's
available to all parts?
>
> 2. Can something similar be done
so the program runs when I commit a feature?
>
> Thanks for
the help so far.
>
> Rui
>
>   "Xavier
Collet" <xcollet@hurni.ch>
wrote in message

href="news:8244FAFC61BED280D94AFFCBF2D04838@in.WebX.maYIadrTaRb">news:8244FAFC61BED280D94AFFC...
...
>  
Yes, you should use the AutoSave:
>
>   This code
should be add into the "Autodesk Inventor Objects\ThisDocument"
section.
>
>
>   Public Sub
AutoSave_DoNothing()
>       MsgBox
"This macro do... nothing"
>   End
Sub
>
>   The message will be prompt each time you
save the file (replace the "DoNothig" with
your function
name).
>
>   Xavier
>    
"RuF" <rui.cad@netcabo.pt> a
écrit dans le message de

href="news:149D88C0BC9E882FB314B8249580AA23@in.WebX.maYIadrTaRb">news:149D88C0BC9E882FB314B82...
...
>    
Hi all
>
>     I'm still looking for a
solution, and I'm sure it's there.
>
>    
Is there any method of running a macro automatically when I save a
file?
>
>    
Thanks
>
>    
Rui
>
>

0 Likes
Message 11 of 18

Anonymous
Not applicable
No you can't, it takes full blown VB, but Brians solution should work for you I would
think. It is a Addin

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"RuiF" wrote in message
news:2C21C45E6DBF787879580993851FC7FD@in.WebX.maYIadrTaRb...
> Not that I'm 100% sure of what an addin is exactly, but I'm almost sure you can't do it
with VBA can you?
>
> Rui
> "Sean Dotson" wrote in message
news:EA60C71EEF80B6865DBDDFA5F69C9B82@in.WebX.maYIadrTaRb...
> I wouldn't even recommend that.
>
> I had a few hundred parts with nothing but a small sub (3-4 lines) and it kept
crashing VBA. Inventor was fine but the VBA environment couldn't handle it.
>
> I'd look at making it an add-in. (which is what I ended up doing with my document
code)
>
>
> --
> Sean Dotson, PE
> http://www.sdotson.com
> Check the Inventor FAQ for most common questions
> www.sdotson.com/faq.html
> -----------------------------------------------------------------------
> "RuiF" wrote in message
news:14D83A200187C47B4409DB1B0215BDA9@in.WebX.maYIadrTaRb...
> Those are some of the reasons why I wanted to keep this as an application macro.
>
> Is there any way for a document macro to call an application program to run?
>
> At least then the document would contain very little code.
>
> Like I said, ideally, I would have an application macro that ran every time a
feature in a part was commited, but so far nobody has been able to help me (added to the
fact that I'm relatively new to IV and VBA, the scenario doesn't get better).
>
> I've been looking at transactions, although I'm not sure if that's what I want.
>
> Thanks in advance for any input you guys may have.
>
> Rui
>
>
> "Kent Keller" wrote in message
news:1355BB64A8DC1A7456AF32A38757749B@in.WebX.maYIadrTaRb...
> Ruif
>
> You may want to read the Subject VBA creation started on the 18th of this month.
Using
> the Auto macros in your templates is not suggested. Also read the subject "A
limit to
> the # of VBA project loaded at one time?" thread started on the 16th
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "RuiF" wrote in message
> news:D2BA59B40BDB3BD6C3A7063FBBAF1B30@in.WebX.maYIadrTaRb...
> > Excellent!! Thanks
> >
> > Now for making my program better:
> >
> > 1. Can I add this to a template file so it's available to all parts?
> >
> > 2. Can something similar be done so the program runs when I commit a feature?
> >
> > Thanks for the help so far.
> >
> > Rui
> >
> > "Xavier Collet" wrote in message
> news:8244FAFC61BED280D94AFFCBF2D04838@in.WebX.maYIadrTaRb...
> > Yes, you should use the AutoSave:
> >
> > This code should be add into the "Autodesk Inventor Objects\ThisDocument"
section.
> >
> >
> > Public Sub AutoSave_DoNothing()
> > MsgBox "This macro do... nothing"
> > End Sub
> >
> > The message will be prompt each time you save the file (replace the "DoNothig"
with
> your function name).
> >
> > Xavier
> > "RuF" a écrit dans le message de
> news:149D88C0BC9E882FB314B8249580AA23@in.WebX.maYIadrTaRb...
> > Hi all
> >
> > I'm still looking for a solution, and I'm sure it's there.
> >
> > Is there any method of running a macro automatically when I save a file?
> >
> > Thanks
> >
> > Rui
> >
> >
>
>
0 Likes
Message 12 of 18

Anonymous
Not applicable
Kent, he would still need to have the code to call the add-in in his
document project (if I understand Brian's example, I haven't downloaded it
yet).

If he puts this in bit of code in each and every part, sooner or later it's
going to blow up in any decent sized assy. I've been doing some more
reading on VBA's memory handling and it's not the best in the world...

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------
"Kent Keller" wrote in message
news:D8892C8C4E2D3CBF6ED97E7687971B8B@in.WebX.maYIadrTaRb...
> No you can't, it takes full blown VB, but Brians solution should work for
you I would
> think. It is a Addin
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "RuiF" wrote in message
> news:2C21C45E6DBF787879580993851FC7FD@in.WebX.maYIadrTaRb...
> > Not that I'm 100% sure of what an addin is exactly, but I'm almost sure
you can't do it
> with VBA can you?
> >
> > Rui
> > "Sean Dotson" wrote in message
> news:EA60C71EEF80B6865DBDDFA5F69C9B82@in.WebX.maYIadrTaRb...
> > I wouldn't even recommend that.
> >
> > I had a few hundred parts with nothing but a small sub (3-4 lines) and
it kept
> crashing VBA. Inventor was fine but the VBA environment couldn't handle
it.
> >
> > I'd look at making it an add-in. (which is what I ended up doing with
my document
> code)
> >
> >
> > --
> > Sean Dotson, PE
> > http://www.sdotson.com
> > Check the Inventor FAQ for most common questions
> > www.sdotson.com/faq.html
>
-----------------------------------------------------------------------
> > "RuiF" wrote in message
> news:14D83A200187C47B4409DB1B0215BDA9@in.WebX.maYIadrTaRb...
> > Those are some of the reasons why I wanted to keep this as an
application macro.
> >
> > Is there any way for a document macro to call an application program
to run?
> >
> > At least then the document would contain very little code.
> >
> > Like I said, ideally, I would have an application macro that ran
every time a
> feature in a part was commited, but so far nobody has been able to help me
(added to the
> fact that I'm relatively new to IV and VBA, the scenario doesn't get
better).
> >
> > I've been looking at transactions, although I'm not sure if that's
what I want.
> >
> > Thanks in advance for any input you guys may have.
> >
> > Rui
> >
> >
> > "Kent Keller" wrote in message
> news:1355BB64A8DC1A7456AF32A38757749B@in.WebX.maYIadrTaRb...
> > Ruif
> >
> > You may want to read the Subject VBA creation started on the 18th
of this month.
> Using
> > the Auto macros in your templates is not suggested. Also read
the subject "A
> limit to
> > the # of VBA project loaded at one time?" thread started on the
16th
> >
> > --
> > Kent
> > Assistant Moderator
> > Autodesk Discussion Forum Moderator Program
> >
> >
> > "RuiF" wrote in message
> > news:D2BA59B40BDB3BD6C3A7063FBBAF1B30@in.WebX.maYIadrTaRb...
> > > Excellent!! Thanks
> > >
> > > Now for making my program better:
> > >
> > > 1. Can I add this to a template file so it's available to all
parts?
> > >
> > > 2. Can something similar be done so the program runs when I
commit a feature?
> > >
> > > Thanks for the help so far.
> > >
> > > Rui
> > >
> > > "Xavier Collet" wrote in message
> > news:8244FAFC61BED280D94AFFCBF2D04838@in.WebX.maYIadrTaRb...
> > > Yes, you should use the AutoSave:
> > >
> > > This code should be add into the "Autodesk Inventor
Objects\ThisDocument"
> section.
> > >
> > >
> > > Public Sub AutoSave_DoNothing()
> > > MsgBox "This macro do... nothing"
> > > End Sub
> > >
> > > The message will be prompt each time you save the file
(replace the "DoNothig"
> with
> > your function name).
> > >
> > > Xavier
> > > "RuF" a écrit dans le message de
> > news:149D88C0BC9E882FB314B8249580AA23@in.WebX.maYIadrTaRb...
> > > Hi all
> > >
> > > I'm still looking for a solution, and I'm sure it's there.
> > >
> > > Is there any method of running a macro automatically when I
save a file?
> > >
> > > Thanks
> > >
> > > Rui
> > >
> > >
> >
> >
>
>
0 Likes
Message 13 of 18

Anonymous
Not applicable
well I haven't had a chance to look at Brian's addin yet either, but as I understood it,
the program ran a normal macro such as in your default.ivb 8^) No need to have it in
every file. I am sure Brian will correct me if I am wrong

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Sean Dotson" wrote in message
news:7F6FC8DD585F6C9EFB249A32D232333E@in.WebX.maYIadrTaRb...
> Kent, he would still need to have the code to call the add-in in his
> document project (if I understand Brian's example, I haven't downloaded it
> yet).
>
> If he puts this in bit of code in each and every part, sooner or later it's
> going to blow up in any decent sized assy. I've been doing some more
> reading on VBA's memory handling and it's not the best in the world...
>
> --
> Sean Dotson, PE
> http://www.sdotson.com
> Check the Inventor FAQ for most common questions
> www.sdotson.com/faq.html
0 Likes
Message 14 of 18

Anonymous
Not applicable
Kent's right. This allows you to have an automatic macro in the default
ivb. This allows you to now do a lot of things with VBA that previously you
could only do using an Add-In.
--
Brian Ekins
Developer Technical Services, Autodesk
Discussion Q&A: http://www.autodesk.com/discussion


"Kent Keller" wrote in message
news:54438BDA5167013E4A9CD9F68337E300@in.WebX.maYIadrTaRb...
> well I haven't had a chance to look at Brian's addin yet either, but as I
understood it,
> the program ran a normal macro such as in your default.ivb 8^) No need
to have it in
> every file. I am sure Brian will correct me if I am wrong
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Sean Dotson" wrote in message
> news:7F6FC8DD585F6C9EFB249A32D232333E@in.WebX.maYIadrTaRb...
> > Kent, he would still need to have the code to call the add-in in his
> > document project (if I understand Brian's example, I haven't downloaded
it
> > yet).
> >
> > If he puts this in bit of code in each and every part, sooner or later
it's
> > going to blow up in any decent sized assy. I've been doing some more
> > reading on VBA's memory handling and it's not the best in the world...
> >
> > --
> > Sean Dotson, PE
> > http://www.sdotson.com
> > Check the Inventor FAQ for most common questions
> > www.sdotson.com/faq.html
>
>
0 Likes
Message 15 of 18

Anonymous
Not applicable
Brian:

 

Great job, working perfectly ....
almost.

 

Probably me, or something I have done wrong, but
what I did was copy your clsEvents class module to my default ivb class
 module and I copied some of your code to create the macro I
wanted.

 

This is working perfectly, every time I save the
macro runs.

 

Problem: I had/have other modules with macros
assigned to buttons on toolbars.  The macros run OK from the MACRO, RUN
dialog, but when I click the button nothing happens. 

 

Any clues?  Have I done something
wrong?

 

I attached a screen shot of my setup.

 

Thanks

 

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Kent's
right.  This allows you to have an automatic macro in the
default
ivb.  This allows you to now do a lot of things with VBA that
previously you
could only do using an Add-In.
--
Brian
Ekins
Developer Technical Services, Autodesk
Discussion Q&A:
href="http://www.autodesk.com/discussion">http://www.autodesk.com/discussion



"Kent
Keller" <kent@strobedata.com>
wrote in message

href="news:54438BDA5167013E4A9CD9F68337E300@in.WebX.maYIadrTaRb">news:54438BDA5167013E4A9CD9F6833...
...
>
well I haven't had a chance to look at Brian's addin yet either, but as
I
understood it,
> the program ran a normal macro such as in your
default.ivb  8^)  No need
to have it in
> every
file.   I am sure Brian will correct me if I am
wrong<G>
>
> --
> Kent
> Assistant
Moderator
> Autodesk Discussion Forum Moderator
Program
>
>
> "Sean Dotson" <sean at sdotson dot com>
wrote in message
>
href="news:7F6FC8DD585F6C9EFB249A32D232333E@in.WebX.maYIadrTaRb">news:7F6FC8DD585F6C9EFB249A32D23...
...
>
> Kent, he would still need to have the code to call the add-in in
his
> > document project (if I understand Brian's example, I haven't
downloaded
it
> > yet).
> >
> > If he puts this
in bit of code in each and every part, sooner or later
it's
> >
going to blow up in any decent sized assy.  I've been doing some
more
> > reading on VBA's memory handling and it's not the best in
the world...
> >
> > --
> > Sean Dotson, PE
>
> http://www.sdotson.com
> >
Check the Inventor FAQ for most common questions
> >
href="http://www.sdotson.com/faq.html">www.sdotson.com/faq.html

>
>

0 Likes
Message 16 of 18

Anonymous
Not applicable
Ah, gotcha. That's good. Don't want all that code running around in the
part files.

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------
"Brian Ekins (Autodesk)" wrote in message
news:002AE70CACBB88605E548BD85A8FAC3C@in.WebX.maYIadrTaRb...
> Kent's right. This allows you to have an automatic macro in the default
> ivb. This allows you to now do a lot of things with VBA that previously
you
> could only do using an Add-In.
> --
> Brian Ekins
> Developer Technical Services, Autodesk
> Discussion Q&A: http://www.autodesk.com/discussion
>
>
> "Kent Keller" wrote in message
> news:54438BDA5167013E4A9CD9F68337E300@in.WebX.maYIadrTaRb...
> > well I haven't had a chance to look at Brian's addin yet either, but as
I
> understood it,
> > the program ran a normal macro such as in your default.ivb 8^) No need
> to have it in
> > every file. I am sure Brian will correct me if I am wrong
> >
> > --
> > Kent
> > Assistant Moderator
> > Autodesk Discussion Forum Moderator Program
> >
> >
> > "Sean Dotson" wrote in message
> > news:7F6FC8DD585F6C9EFB249A32D232333E@in.WebX.maYIadrTaRb...
> > > Kent, he would still need to have the code to call the add-in in his
> > > document project (if I understand Brian's example, I haven't
downloaded
> it
> > > yet).
> > >
> > > If he puts this in bit of code in each and every part, sooner or later
> it's
> > > going to blow up in any decent sized assy. I've been doing some more
> > > reading on VBA's memory handling and it's not the best in the world...
> > >
> > > --
> > > Sean Dotson, PE
> > > http://www.sdotson.com
> > > Check the Inventor FAQ for most common questions
> > > www.sdotson.com/faq.html
> >
> >
>
>
0 Likes
Message 17 of 18

Anonymous
Not applicable
Brian:

 

No clues as to why my other macros don't run via a
button now?

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Brian:

 

Great job, working perfectly ....
almost.

 

Probably me, or something I have done wrong, but
what I did was copy your clsEvents class module to my default ivb class
 module and I copied some of your code to create the macro I
wanted.

 

This is working perfectly, every time I save the
macro runs.

 

Problem: I had/have other modules with macros
assigned to buttons on toolbars.  The macros run OK from the MACRO, RUN
dialog, but when I click the button nothing happens. 

 

Any clues?  Have I done something
wrong?

 

I attached a screen shot of my
setup.

 

Thanks

 

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Kent's
right.  This allows you to have an automatic macro in the
default
ivb.  This allows you to now do a lot of things with VBA
that previously you
could only do using an Add-In.
--
Brian
Ekins
Developer Technical Services, Autodesk
Discussion Q&A:
href="http://www.autodesk.com/discussion">http://www.autodesk.com/discussion



"Kent
Keller" <kent@strobedata.com>
wrote in message

href="news:54438BDA5167013E4A9CD9F68337E300@in.WebX.maYIadrTaRb">news:54438BDA5167013E4A9CD9F68...
...
>
well I haven't had a chance to look at Brian's addin yet either, but as
I
understood it,
> the program ran a normal macro such as in your
default.ivb  8^)  No need
to have it in
> every
file.   I am sure Brian will correct me if I am
wrong<G>
>
> --
> Kent
> Assistant
Moderator
> Autodesk Discussion Forum Moderator
Program
>
>
> "Sean Dotson" <sean at sdotson dot
com> wrote in message
>
href="news:7F6FC8DD585F6C9EFB249A32D232333E@in.WebX.maYIadrTaRb">news:7F6FC8DD585F6C9EFB249A32D...
...
>
> Kent, he would still need to have the code to call the add-in in
his
> > document project (if I understand Brian's example, I
haven't downloaded
it
> > yet).
> >
> > If he
puts this in bit of code in each and every part, sooner or
later
it's
> > going to blow up in any decent sized assy. 
I've been doing some more
> > reading on VBA's memory handling and
it's not the best in the world...
> >
> > --
> >
Sean Dotson, PE
> >
href="http://www.sdotson.com">http://www.sdotson.com

> > Check
the Inventor FAQ for most common questions
> >
href="http://www.sdotson.com/faq.html">www.sdotson.com/faq.html

>
>

0 Likes
Message 18 of 18

Anonymous
Not applicable
Hi Rui,

 

I was able to reproduce your problem and did a bit
of investigation and have found the problem.  It is related to this
Add-In.  When you start Inventor, my Add-In looks for and runs the
AutoStart macro.  In Inventor 7, the application project wasn't actually
loaded until the VBA editor was invoked.  Because of this my Add-In loaded
the application project.  However, Inventor became confused and thought
this was a user project since it had been loaded by someone else.  This
messes up Inventor being able to find macros that are associated with buttons
and also breaks the ability to add new buttons for macros.  The behavior in
Inventor 8 has already been changed so that if you access the VBA projects
through the API it will automatically force the loading of the application
project.  Because of this change, my Add-In works correctly with Inventor
8, although I'll probably post a newer version for 8 because I can actually
simplify my code quite a bit.
--
Brian Ekins
Developer Technical
Services, Autodesk
Discussion Q&A:
href="http://www.autodesk.com/discussion">http://www.autodesk.com/discussion



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Brian:

 

No clues as to why my other macros don't run via
a button now?

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Brian:

 

Great job, working perfectly ....
almost.

 

Probably me, or something I have done wrong,
but what I did was copy your clsEvents class module to my default ivb class
 module and I copied some of your code to create the macro I
wanted.

 

This is working perfectly, every time I save
the macro runs.

 

Problem: I had/have other modules with macros
assigned to buttons on toolbars.  The macros run OK from the MACRO, RUN
dialog, but when I click the button nothing happens. 

 

Any clues?  Have I done something
wrong?

 

I attached a screen shot of my
setup.

 

Thanks

 

 

Rui

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Kent's
right.  This allows you to have an automatic macro in the
default
ivb.  This allows you to now do a lot of things with VBA
that previously you
could only do using an Add-In.
--
Brian
Ekins
Developer Technical Services, Autodesk
Discussion Q&A:
href="http://www.autodesk.com/discussion">http://www.autodesk.com/discussion



"Kent
Keller" <
href="mailto:kent@strobedata.com">kent@strobedata.com
> wrote in
message

href="news:54438BDA5167013E4A9CD9F68337E300@in.WebX.maYIadrTaRb">news:54438BDA5167013E4A9CD9F...
...
>
well I haven't had a chance to look at Brian's addin yet either, but as
I
understood it,
> the program ran a normal macro such as in your
default.ivb  8^)  No need
to have it in
> every
file.   I am sure Brian will correct me if I am
wrong<G>
>
> --
> Kent
> Assistant
Moderator
> Autodesk Discussion Forum Moderator
Program
>
>
> "Sean Dotson" <sean at sdotson dot
com> wrote in message
>
href="news:7F6FC8DD585F6C9EFB249A32D232333E@in.WebX.maYIadrTaRb">news:7F6FC8DD585F6C9EFB249A3...
...
>
> Kent, he would still need to have the code to call the add-in in
his
> > document project (if I understand Brian's example, I
haven't downloaded
it
> > yet).
> >
> > If
he puts this in bit of code in each and every part, sooner or
later
it's
> > going to blow up in any decent sized
assy.  I've been doing some more
> > reading on VBA's memory
handling and it's not the best in the world...
> >
> >
--
> > Sean Dotson, PE
> >
href="http://www.sdotson.com">http://www.sdotson.com

> >
Check the Inventor FAQ for most common questions
> >
href="http://www.sdotson.com/faq.html">www.sdotson.com/faq.html

>
>

0 Likes