Recording a macro in Inventor 2016

Recording a macro in Inventor 2016

Anonymous
Not applicable
13,355 Views
11 Replies
Message 1 of 12

Recording a macro in Inventor 2016

Anonymous
Not applicable

It is possible to record a macro in Inventor 2016 as I would do in Excel?

 

I have read in an previous post it wasn´t possible in Inventor 2014, but I see an icon called "macro" in Inventor 2016 that make me think it is possible now. The matter is that I press it and nothing happens.

0 Likes
13,356 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable

The Macro button pops up a window showing a list of VBA macros that you typed. There is no macro recorder.

0 Likes
Message 3 of 12

Anonymous
Not applicable
Could you tell me how can I make it work?
Do you know how can I do to install VBA to work it in Inventor?
0 Likes
Message 4 of 12

Anonymous
Not applicable
I mean, how can I make the macro button work
0 Likes
Message 5 of 12

Anonymous
Not applicable

Does anyone know where is the VBA installer for Invenor 2016. I can't find it and MACRO and VBA buttons don't work without installing the program.

Thanks.

0 Likes
Message 6 of 12

Owner2229
Advisor
Advisor

Hi, VBA is part of Inventor, there's no need to install anything.

Here is sample code, that will let you know the button is working:

 

Public Sub RunMyRuleOne()
    MsgBox "Working..."
End Sub

Here is how to set up the button:

 

1) In Inventor pres Alt + F11

    Window named "Microsoft Visual Basic For Application" should pop up

    On left there should be "Application Project (Default.ivb)"

2) Expand it.

3) Right-click on "Modules" > "Insert" > "Module"

4) Paste the code above.

5) Save and close "Microsoft Visual Basic For Application" window.

6) In Inventor in opened assembly go to "Tools" > "Customize"

7) In left tab expand the dropbox and select "Macros".

8) In right tab expand the dropbox and select "Assembly | Assembly"

9) In left tab select "RunMyRuleOne".

10) Click on the arrows leading to right.

11) Click "Apply" and "Close".

12) In assembly go to "Assembly" tab and you should see there "User Commands". (On the right side of Ribbon)

13) The button should be there. Use it to run the code.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 7 of 12

Anonymous
Not applicable

Hi Kudos.

Thanks for the answer. But problem is pressing Alt+F11 Nothing happens... Except for maybe what I show in the photo linked. See that numbers in front of different options? Well. I dont know. Nothing pops up, and MACRO and VBA dont do anything. If you could help me id be grateful.altf11.png

0 Likes
Message 8 of 12

Anonymous
Not applicable
0 Likes
Message 9 of 12

xiaodong_liang
Autodesk Support
Autodesk Support
Hi ines.mondos,

It looks your original question has been answered, i.e. no macro recorder for Inventor. while you could mimic user operations to write codes, yet it would not be a small code if it is complex workflow.
0 Likes
Message 10 of 12

xiaodong_liang
Autodesk Support
Autodesk Support
Hi claudio.fernandez,

What would happen if you click the menu Tools>>Options>>VBA Editor?
0 Likes
Message 11 of 12

michael_berger
Contributor
Contributor

Hello 

i have the same problem as claudio,

i can see the buttons "macros" and "VBA-Editor" in the Toolbar... but if i click on it nothing happens...

 

i just tried to install the VBA7.1 for x64 but also nothing happens..

i just repaired the installatione of inventor 2016 ... nothing happens.

i installed all hotfixes and servicepacks for inventor 2016 - subscription.... but ... guess....

 

exactly... nothing happens....

 

i use PDSU2016 x64.... with product stream professional 2011 with the client-patches.... (we are in the process to change pspro to vault -  but it is still not working...)

 

so please help me...

it is really nessersary to use vba for automation to delete ole - links for changing to vault ....

 

thanks.

0 Likes
Message 12 of 12

xiaodong_liang
Autodesk Support
Autodesk Support
Hi Michael,

Sorry for hearing you are struggling to make it work. Although VBA Editor is for using API codes, it is more a product menu in UI. I have not an experience on such issue. May I suggest you post the question on Inventor product board? probably some products experts would have comments
http://forums.autodesk.com/t5/inventor-general-discussion/bd-p/78
0 Likes