Need help with Inventor VBA to do actions during Save Events

Need help with Inventor VBA to do actions during Save Events

Anonymous
Not applicable
775 Views
7 Replies
Message 1 of 8

Need help with Inventor VBA to do actions during Save Events

Anonymous
Not applicable

Hello,

 

I'm working on a project for my company where I takes documents from AutoCAD 2015 and Inventor 2015 and make copies of them during the save event to be placed in a different directory so they can be converted to .pdfs. I have this done in AutoCAD and was now just trying to do in Inventor as well. However, even though I was able to find the vba editor easily enough in Inventor 2015, I can not seem to find a working function that interacts with Inventor whenever the user saves. Once I find a way to interact with it I should be all right with the coding I already did for the AutoCAD side.

 

Also, is there a way to save the coding in a seperate file, like .dvb for AutoCAD?

0 Likes
776 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Hello?

0 Likes
Message 3 of 8

MechMachineMan
Advisor
Advisor

If you have Inventor on your computer go find the

 

C:\Program Files\Autodesk\Inventor 2014\Local Help\admapi_18_0.chm file and check it out. It's a good reference to start with for inventor.

 

(Also found by going to Programming Help through the question mark in the top right on the open inventor window)


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 4 of 8

Anonymous
Not applicable

I'm not sure for VBA but there are triggers that will run iLogic rules. see the attached screenshot.

 

Untitled.gif

Message 5 of 8

MechMachineMan
Advisor
Advisor
To add, using Ken's method requires changing templates and may no work the greatest for already created files.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 6 of 8

Anonymous
Not applicable

Hello, thanks for look at my post and offering suggestions, but it's my fault for not being specfic in the first post. I'm working in the VBA and would like to do something like this code I have for AutoCAD, but use it instead for Inventor:

 

"Private Sub AcadDocument_BeginClose()
Dim name As String
name = ThisDrawing.name
ThisDrawing.SaveAs "C:\otherDirectory\TEMPLATE\test\" & name
End Sub"

 

I'm saving it in the other directory s a backup and for conversion purporses later.

 

Also does the Inventor VBA have some similar to "Private Sub AcadDocument_EndSave(ByVal FileName As String)" and "Private Sub AcadDocument_BeginSave(ByVal FileName As String)" functions?

0 Likes
Message 7 of 8

Anonymous
Not applicable
hello?
0 Likes
Message 8 of 8

GeorgK
Advisor
Advisor

Did you search the forum? There are a lot of samples.

 

Cheers

 

Georg

0 Likes