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: 

Inv 2014 Removes support for VBA auto-run Macros

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
karthur1
2404 Views, 9 Replies

Inv 2014 Removes support for VBA auto-run Macros

In the readme for Inventor 2014... I see this information:

 

Inventor 2014 removes support for VBA auto-run macros which are embedded in Inventor documents. These VBA macros are named: “AutoOpen”, “AutoNew”, “AutoSave”, “AutoClose” and “AutoEdit”. They can severely impact Inventor performance and pose a possible security risk. The suggested alternative to auto-run macros is to create an Inventor add-in.

 

I guess this is the reason that my macro (that uses Autosave) does not work any longer.  This is a real deal breaker for 2014 for me.  This macro is in EVERY idw that I create and it must work.  It has been working since Inventor R4.  The suggestion given is to create an Inventor Add-in.  I dont have clue how to convert this to an Inventor add-in.

 

Any takers on converting it for me?  Attached is the code.

 

Thanks

 

 

9 REPLIES 9
Message 2 of 10
waynehelley
in reply to: karthur1

what about running the code from ilogic?

 

If the commands you are using are not possible to rewrite in ilogic, it is possible to trigger a VB Macro to run from ilogic.

 

Using 'Event Triggers' you can set the rule to run upto creating a document.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 3 of 10
karthur1
in reply to: karthur1

The code is embedded in my idw's. ilogic would be a solution for new idw's, but for existing legacy idw's, that is not a solution.
Not a solution because each idw would have to have the "before save" trigger set before it would run.
Message 4 of 10
Message 5 of 10

Curtis,

No use since this will not work with an external iLogic code.  I am looking at converting my code to an add-in.

 

Thanks

Message 6 of 10
waynehelley
in reply to: karthur1

from my experience with the code injector, I am fairly sure that there is an option to keep rules as internal rules after running the injector.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 7 of 10
waynehelley
in reply to: waynehelley

Code Injector.png

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 8 of 10
karthur1
in reply to: waynehelley

I want to keep the the ilogic code as an external rule and the trigger should be set to "before save".  I will need to experiment and see if I can get the code injector to do that.

 

I dont see an option for external rules in your screen capture.

 

I still have an issue with all my legacy idw files... all the way back from Inv 4.  They are all in vault (1,000's of them).  I would have to search for them, get latest from vault, check them out, run this code injector, then check them back in.... pray that there are not hickups along the way.

Message 9 of 10
philippe.leefsma
in reply to: karthur1

Hi Karthur1,

 

It's been several years now that we've encouraged developers to move away from those auto macros, mentionning that they will be removed at some point. Converting your VBA code to Vb.Net would be a matter of minutes.

 

We've been publishing numerous resources to help you achieve the migration VBA to .Net addins:

 

http://modthemachine.typepad.com/my_weblog/2008/10/converting-vba-auto-macros-to-an-add-in.html

 

http://download.autodesk.com/media/adn/VBA_Migration/DevTV_Recording/VBA_Migration.html

 

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=770215

 

I hope it helps.

 

Best Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 10 of 10
karthur1
in reply to: karthur1

Thanks Wayne Brill so converting this for me.  Works great!!

 

You can find Waynes blog here about the addin that he wrote. 

 

It is also attached here just in case the link gets broken in the future.

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

Post to forums  

Autodesk Design & Make Report