iLogic - VBA code

iLogic - VBA code

Anonymous
Not applicable
2,271 Views
4 Replies
Message 1 of 5

iLogic - VBA code

Anonymous
Not applicable

Hi All,

 

Can you tell me if you can write and execute vba code inside ilogic, please?.

 

Thanks.

0 Likes
Accepted solutions (1)
2,272 Views
4 Replies
Replies (4)
Message 2 of 5

Lewis.Young
Collaborator
Collaborator

Hello,

 

As far as i'm aware, you can run straight VB.NET code within iLogic.

If you wan't to run straight VBA code (slightly different to VB.NET) instead, you should use the Inventor API by going to the "Tools" tab and opening the VBA editor. Inventor API can read more languages including VBA, C++, C#.

 

 

Lewis Young
Windows 7 x64 - 32GB Ram
Intel Xeon E5-1620 v2 @ 3.70GHz
nVidia Quadro M2000 - 4GB
Inventor Professional 2017.3
Vault Basic 2017

Message 3 of 5

dgreatice
Collaborator
Collaborator
Accepted solution

Hi,

 

You can try this example:

1. In Inventor menus, select Tools > VBA Editor,

2. In ApplicationProject > Modules > Module1, put this code:

 

Public Sub HelloWorld()

     MsgBox "Hello World", vbInformation, "Hello World"

End Sub

 

3. Back to Inventor, in iLogic browser, create New Rule "Rule0" and type this:

 

InventorVb.RunMacro("ApplicationProject", "Module1", "HelloWorld")

 

 

 

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 4 of 5

Anonymous
Not applicable

Where and how is the VBA code stored in Inventor?

 

I'm asking because you don't have to create a new document before writing the VBA code, So I just curious as to where and how it is stored

0 Likes
Message 5 of 5

Anonymous
Not applicable

To the best of my knowledge it is stored in a .ivb file that you can set from the application options->file tab->default vba project.

 

-Chancellor

0 Likes