Multiple Model States to .STP with Vault Upload

Multiple Model States to .STP with Vault Upload

taylorUJ7H2
Contributor Contributor
255 Views
3 Replies
Message 1 of 4

Multiple Model States to .STP with Vault Upload

taylorUJ7H2
Contributor
Contributor

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.

0 Likes
256 Views
3 Replies
Replies (3)
Message 2 of 4

ryan.rittenhouse
Advocate
Advocate

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

If this solved your problem, or answered your question, please click Accept Solution.
0 Likes
Message 3 of 4

taylorUJ7H2
Contributor
Contributor

Hey, I have IV 2025 and Vault Professional 2025

0 Likes
Message 4 of 4

ryan.rittenhouse
Advocate
Advocate

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)

 

If this solved your problem, or answered your question, please click Accept Solution.
0 Likes