Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading Macros

13 REPLIES 13
Reply
Message 1 of 14
Anonymous
756 Views, 13 Replies

Loading Macros

I have programmed a macro and set the default path for VBA programs under
Tools>Application Options>File and placed all of the .ivb's in that folder.
When I start Inventor and go to Tools>Macro>Macros nothing is shown in the
macros window and nothing is selectable except cancel. Once I go through
the Tools>Macro>Visual Basic Editor and load the program then as long as I
don't exit Inventor the macro is visible in the Macro window. Am I missing
something?

Any help would be fantastic!!
Thanks in advance.
Bryan Hemphill
Systematix Inc.
13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: Anonymous

Bryan

Might be missing the question, but only one VBA program gets autoloaded.

the default setup loads Default.ivb. The only thing you can do is have it autoload some
other ivb file.

--
Kent


"Bryan Hemphill" wrote in message
news:25E80A686D04974CB4CFFC079AD3DE71@in.WebX.maYIadrTaRb...
> I have programmed a macro and set the default path for VBA programs under
> Tools>Application Options>File and placed all of the .ivb's in that folder.
> When I start Inventor and go to Tools>Macro>Macros nothing is shown in the
> macros window and nothing is selectable except cancel. Once I go through
> the Tools>Macro>Visual Basic Editor and load the program then as long as I
> don't exit Inventor the macro is visible in the Macro window. Am I missing
> something?
>
> Any help would be fantastic!!
> Thanks in advance.
> Bryan Hemphill
> Systematix Inc.
>
>
Message 3 of 14
Anonymous
in reply to: Anonymous

Thanks Kent. I never thought of having default.ivb call the other projects.

Bryan Hemphill
Systematix Inc.
Message 4 of 14
Anonymous
in reply to: Anonymous

I'm new to inventor and am currently trying to determine the best method of
loading my vba at inventor startup.

I am use to AutoCAD where I have my acad.dvb with references.

In inventor I have set up a default.ivb that loads. It does not load
references. I have added a function that can load my macro files but do not
know how to make that function run at startup.

I thought my best option was to ask the question "How do others do this?". I
may be on the wrong track.

Thanks
Martin
Message 5 of 14
Anonymous
in reply to: Anonymous

No response!!
I thought this would be a common problem with a well resolved solution.
I have continued along my own path and my current thought is to create a
function in my default.ivb file that loads all of the projects that I
require at startup.
I have found out about add-ins and created a test one.
I intend this to run the load function in the default.ivb.

Is this how everyone else does it?
Is it a good method?
What is the best method?

Thanks
Martin Wright
Message 6 of 14
Anonymous
in reply to: Anonymous

If you are going to load all these at startup anyhow, why not just make
them part of Default.ivb?

It is possible to load and run other ivb files. My iBatchRun program
and Charles MrMacro do it. Is it loading the files you are having
trouble with or doing it automatically on start?

--
Kent Keller
http://www.MyMcad.com/KWiK/Mcad.htm

Assistant Moderator
Autodesk Discussion Forum Moderator Program

"Martin Wright" wrote in message
news:ACDB2CE403A5F19886E28675EA764E22@in.WebX.maYIadrTaRb...
> No response!!
> I thought this would be a common problem with a well resolved
solution.
> I have continued along my own path and my current thought is to create
a
> function in my default.ivb file that loads all of the projects that I
> require at startup.
> I have found out about add-ins and created a test one.
> I intend this to run the load function in the default.ivb.
>
> Is this how everyone else does it?
> Is it a good method?
> What is the best method?
>
> Thanks
> Martin Wright
>
>
Message 7 of 14
Anonymous
in reply to: Anonymous

HI Kent

I would like to automatically load the ivb files on start.

I am new to inventor and am in the process of assesing it for the change
over from AutoCAD. I need a system that I can manage transparently across 40
machines so other users are unaware of any changes I may need to make.

I prefer not to place all the code in the default.ivb simply for manage the
code.

Thanks
Martin

"Kent Keller" wrote in message
news:A602C3D452BC010B464D5F39F3BB9795@in.WebX.maYIadrTaRb...
> If you are going to load all these at startup anyhow, why not just make
> them part of Default.ivb?
>
> It is possible to load and run other ivb files. My iBatchRun program
> and Charles MrMacro do it. Is it loading the files you are having
> trouble with or doing it automatically on start?
>
> --
> Kent Keller
> http://www.MyMcad.com/KWiK/Mcad.htm
>
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
> "Martin Wright" wrote in message
> news:ACDB2CE403A5F19886E28675EA764E22@in.WebX.maYIadrTaRb...
> > No response!!
> > I thought this would be a common problem with a well resolved
> solution.
> > I have continued along my own path and my current thought is to create
> a
> > function in my default.ivb file that loads all of the projects that I
> > require at startup.
> > I have found out about add-ins and created a test one.
> > I intend this to run the load function in the default.ivb.
> >
> > Is this how everyone else does it?
> > Is it a good method?
> > What is the best method?
> >
> > Thanks
> > Martin Wright
> >
> >
>
>
Message 8 of 14
Anonymous
in reply to: Anonymous

Martin

If I was trying to do what you want, I think I would go the route that
you sound like you are headed. Have a Addin run the Load functions when
needed in the Default.ivb. You may also want to reference the recent
thread. "AutoMatic Macro Running" I am not sure if Brian's Addin will
do what you are after but I guess it is on hold until R8 comes out.

If you want to run them anytime Inventor starts then put the calls in
the ApplicationAddInServer_Activate sub, or if you want them run any
time a new file is started then you will need to set up the appropriate
event handlers.

The code below should get you started on how to set up the Default.ivb
file. (note I grabbed this out of a addin and didn't spend a lot of
time verifying the code, but it should run good enough to get some ideas
from hopefully. 8^)



Public Sub test()

Dim oVBA As InventorVBAProjects
Dim oVBAProject As InventorVBAProject
Dim oVBAComponent As InventorVBAComponent
Dim oVBAMember As InventorVBAMember
Dim iProjects As Integer

Set oVBA = ThisApplication.VBAProjects

oVBA.Open ("C:\Documents and Settings\Kent
Keller\Desktop\SaveAs.ivb")

For Each oVBAProject In oVBA
For Each oVBAComponent In oVBAProject.InventorVBAComponents
For Each oVBAMember In oVBAComponent.InventorVBAMembers
On Error Resume Next
If oVBAMember.MemberType = kSubMember Then
If Err.Number = 0 Then
MsgBox oVBAProject.VBProject.FileName
MsgBox oVBAMember.Name
If oVBAMember.Name <> "test" Then
oVBAMember.Execute
End If

End If
End If
Next
Next
Next

End Sub


--
Kent Keller
http://www.MyMcad.com/KWiK/Mcad.htm

Assistant Moderator
Autodesk Discussion Forum Moderator Program

"Martin Wright" wrote in message
news:AAFBB5FA843F23F3A5321859890DE787@in.WebX.maYIadrTaRb...
> HI Kent
>
> I would like to automatically load the ivb files on start.
>
Message 9 of 14
Anonymous
in reply to: Anonymous

Thanks for your advice Kent.
I have read the recent thread . "AutoMatic Macro Running". I got all excited
and downloaded Brians files prior to reading the later postings.
I was also interested in the problems with too many macros loaded.
I had intended to load the minimum number of files with the bulk loaded on
request by toolbar buttons and automatically unloaded on completion of the
function.

Regards
Martin Wright


"Kent Keller" wrote in message
news:C8215448AEA6BEA364AE63E68F9A00AD@in.WebX.maYIadrTaRb...
> Martin
>
> If I was trying to do what you want, I think I would go the route that
> you sound like you are headed. Have a Addin run the Load functions when
> needed in the Default.ivb. You may also want to reference the recent
> thread. "AutoMatic Macro Running" I am not sure if Brian's Addin will
> do what you are after but I guess it is on hold until R8 comes out.
>
> If you want to run them anytime Inventor starts then put the calls in
> the ApplicationAddInServer_Activate sub, or if you want them run any
> time a new file is started then you will need to set up the appropriate
> event handlers.
>
> The code below should get you started on how to set up the Default.ivb
> file. (note I grabbed this out of a addin and didn't spend a lot of
> time verifying the code, but it should run good enough to get some ideas
> from hopefully. 8^)
>
>
>
> Public Sub test()
>
> Dim oVBA As InventorVBAProjects
> Dim oVBAProject As InventorVBAProject
> Dim oVBAComponent As InventorVBAComponent
> Dim oVBAMember As InventorVBAMember
> Dim iProjects As Integer
>
> Set oVBA = ThisApplication.VBAProjects
>
> oVBA.Open ("C:\Documents and Settings\Kent
> Keller\Desktop\SaveAs.ivb")
>
> For Each oVBAProject In oVBA
> For Each oVBAComponent In oVBAProject.InventorVBAComponents
> For Each oVBAMember In oVBAComponent.InventorVBAMembers
> On Error Resume Next
> If oVBAMember.MemberType = kSubMember Then
> If Err.Number = 0 Then
> MsgBox oVBAProject.VBProject.FileName
> MsgBox oVBAMember.Name
> If oVBAMember.Name <> "test" Then
> oVBAMember.Execute
> End If
>
> End If
> End If
> Next
> Next
> Next
>
> End Sub
>
>
> --
> Kent Keller
> http://www.MyMcad.com/KWiK/Mcad.htm
>
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
> "Martin Wright" wrote in message
> news:AAFBB5FA843F23F3A5321859890DE787@in.WebX.maYIadrTaRb...
> > HI Kent
> >
> > I would like to automatically load the ivb files on start.
> >
>
>
Message 10 of 14
Anonymous
in reply to: Anonymous

In case others are interested my final method works like this:

I have created an addin
This addin loads a file startup.ivb
It then runs all routines found in startup.ivb
Within startup.ivb I have a function named MacroLoad
MacroLoad loads all files that I want perminately loaded.

I may add to unload startup.ivb as it is no longer required


"Kent Keller" wrote in message
news:C8215448AEA6BEA364AE63E68F9A00AD@in.WebX.maYIadrTaRb...
> Martin
>
> If I was trying to do what you want, I think I would go the route that
> you sound like you are headed. Have a Addin run the Load functions when
> needed in the Default.ivb. You may also want to reference the recent
> thread. "AutoMatic Macro Running" I am not sure if Brian's Addin will
> do what you are after but I guess it is on hold until R8 comes out.
>
> If you want to run them anytime Inventor starts then put the calls in
> the ApplicationAddInServer_Activate sub, or if you want them run any
> time a new file is started then you will need to set up the appropriate
> event handlers.
>
> The code below should get you started on how to set up the Default.ivb
> file. (note I grabbed this out of a addin and didn't spend a lot of
> time verifying the code, but it should run good enough to get some ideas
> from hopefully. 8^)
>
>
>
> Public Sub test()
>
> Dim oVBA As InventorVBAProjects
> Dim oVBAProject As InventorVBAProject
> Dim oVBAComponent As InventorVBAComponent
> Dim oVBAMember As InventorVBAMember
> Dim iProjects As Integer
>
> Set oVBA = ThisApplication.VBAProjects
>
> oVBA.Open ("C:\Documents and Settings\Kent
> Keller\Desktop\SaveAs.ivb")
>
> For Each oVBAProject In oVBA
> For Each oVBAComponent In oVBAProject.InventorVBAComponents
> For Each oVBAMember In oVBAComponent.InventorVBAMembers
> On Error Resume Next
> If oVBAMember.MemberType = kSubMember Then
> If Err.Number = 0 Then
> MsgBox oVBAProject.VBProject.FileName
> MsgBox oVBAMember.Name
> If oVBAMember.Name <> "test" Then
> oVBAMember.Execute
> End If
>
> End If
> End If
> Next
> Next
> Next
>
> End Sub
>
>
> --
> Kent Keller
> http://www.MyMcad.com/KWiK/Mcad.htm
>
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
> "Martin Wright" wrote in message
> news:AAFBB5FA843F23F3A5321859890DE787@in.WebX.maYIadrTaRb...
> > HI Kent
> >
> > I would like to automatically load the ivb files on start.
> >
>
>
Message 11 of 14
Anonymous
in reply to: Anonymous

Bryan

Sorry, I think you misread me. Unfortunately you cant have the default.ivb call the
other projects(I already asked about that one and sure hope we can with the next release)

You either need to consolidate all the info in default.ivb (or what ever project you make
the default) or manually load them. Also as Brian pointed out in the other NG each
document has its own project, so I would presume you could put some of it in a template
.... haven't tried that though!

--
Kent


"Bryan Hemphill" wrote in message
news:E57BB964B139E1528A7DFD3C49D12578@in.WebX.maYIadrTaRb...
> Thanks Kent. I never thought of having default.ivb call the other projects.
>
> Bryan Hemphill
> Systematix Inc.
>
>
Message 12 of 14
Anonymous
in reply to: Anonymous

Kent,

Thanks again for clarifying that! I tried placing the macro in my template
assembly and it is available from any assembly I create! This will work
great!

Bryan Hemphill
Systematix Inc.
Message 13 of 14
Anonymous
in reply to: Anonymous

As a preview....

an upcoming release adds some nice tools.

AutoNew - make a macro in a template every time the "new" event happens this
macro is run
AutoOpen - every time a doc is opened this macro is run
AutoEdit - every time a doc is edited this macro is run
AutoSave - every time a doc is saved this macro is run.

All one must do is create a macro in you template or any file for that
matter, templates just make it easy, with the above names an voila!
I will let this sink in............... : ) Smile. If you think about it,
you can do some cool things.....

-Kevin Schneider


"Bryan Hemphill" wrote in message
news:50C2C06A4A854B9A992EC3C93C524A4D@in.WebX.maYIadrTaRb...
> Kent,
>
> Thanks again for clarifying that! I tried placing the macro in my
template
> assembly and it is available from any assembly I create! This will work
> great!
>
> Bryan Hemphill
> Systematix Inc.
>
>
>
>
Message 14 of 14
Anonymous
in reply to: Anonymous

Kevin,

Please consider AutoPrint or some other Print event handling too, this could
be used to force the user to specify some information before printing or
just to register all the print made for a project or customer to some kind
of billing system.

Patrick de Stobbeleir


"Kevin Schneider (Autodesk, Inc.)" wrote in
message news:DE52F260CD9D59BD0B276BE048432FD1@in.WebX.maYIadrTaRb...
| As a preview....
|
| an upcoming release adds some nice tools.
|
| AutoNew - make a macro in a template every time the "new" event happens
this
| macro is run
| AutoOpen - every time a doc is opened this macro is run
| AutoEdit - every time a doc is edited this macro is run
| AutoSave - every time a doc is saved this macro is run.
|
| All one must do is create a macro in you template or any file for that
| matter, templates just make it easy, with the above names an voila!
| I will let this sink in............... : ) Smile. If you think about it,
| you can do some cool things.....
|
| -Kevin Schneider
|
|
| "Bryan Hemphill" wrote in message
| news:50C2C06A4A854B9A992EC3C93C524A4D@in.WebX.maYIadrTaRb...
| > Kent,
| >
| > Thanks again for clarifying that! I tried placing the macro in my
| template
| > assembly and it is available from any assembly I create! This will work
| > great!
| >
| > Bryan Hemphill
| > Systematix Inc.
| >
| >
| >
| >
|
|

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report