Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

VBA Drawing Document "Save" Action?

PECJon
Explorer

VBA Drawing Document "Save" Action?

PECJon
Explorer
Explorer

We're coming to Inventor from 2D graphics software in which we used a lot of VBA to automate functions for drafting. We had tied some functions in when we save our documents using the following built in routines that fire when certain document actions are fired such as "Save" etc.

 

 

Private Sub GlobalMacroStorage_DocumentBeforeSave(ByVal Doc As Document, ByVal SaveAs As Boolean, ByVal FileName As String)

 

 

Private Sub GlobalMacroStorage_DocumentAfterSave(ByVal Doc As Document, ByVal SaveAs As Boolean, ByVal FileName As String)

 

 

Private Sub GlobalMacroStorage_DocumentOpen(ByVal Doc As Document, ByVal FileName As String)

 

 

I haven't seen this type of built in functionality in Inventor's implementation of VBA. Am I missing anything? I'm not trying to automate the save process, just what happens when the user saves. Thanks!

0 Likes
Reply
Accepted solutions (1)
662 Views
4 Replies
Replies (4)

TA.Fehr
Advocate
Advocate
Accepted solution

I may be misunderstanding your intention, but I have a number of functions that are kicked off when the user saves.

For example, I created an iLogic function that iterates through each drawing and ensures a rev table is added for each page every time there is a save. This is triggered through the Event Triggers under the Manage tab.Capture.PNG

You'll find iLogic is pretty close to VBA, so if you should be able to figure how to implement your old codes.

0 Likes

PECJon
Explorer
Explorer

Very interesting thank you. I hadn't realized this type of script functionality was also built in. I will be taking a look at that over the next week! Much appreciated.

0 Likes

PECJon
Explorer
Explorer

Accepting this as a solution however hoping to find document triggers in VBA as well in the future. Thanks!

0 Likes

TA.Fehr
Advocate
Advocate

I guess your alternative would be to build an add-in that has a bunch of triggers built in for any event you would like to initiate an action for. But by the sounds of it, this would be a little excessive for what your looking for.

0 Likes