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

Multiple Model States to .STP with Vault Upload

Seeking an iLogic script that loops through all model states, saves each as a .STP file in a selected folder, and uploads the files to Vault. The selected folder will be within the working folder.

 

I found a script that partially meets this requirement: https://forums.autodesk.com/t5/inventor-programming-ilogic/export-all-model-states-to-individual-ste...

 

However, it does not upload the created .STP's to Vault automatically.

Labels (4)

How I'd solve the upload depends on the version of Inventor you are using. What version do you have to work with?

taylorUJ7H2
in reply to: taylorUJ7H2

Hey, I have IV 2025 and Vault Professional 2025

That makes it real easy. Add the code (shown below) right after the file gets saved (oSTEPTranslator.SaveCopyAs) in the main loop. If you don't use "$WorkingFolder" as your local vault folder, you'll need to change it to your proper folder name. This will park the file in the vault. The only gotcha is that it only works if the folder you are sending it to already exists in the vault.

 

	Dim vaultPath = System.IO.Path.GetDirectoryName(oData.FileName).Replace("C:\$WorkingFolder", "$").Replace("\", "/") & "/"
	iLogicVault.AddFile(oData.FileName, vaultPath)