Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Save and check in all open documents

alexander.duell
Contributor

Save and check in all open documents

alexander.duell
Contributor
Contributor

Hi,

 

I am trying to write an Ilogic code that saves and basically checks in all open documents in Inventor to Vault. Both IPT's, IAM's and drawings. It does not check in all documents, but I can't figure out why...

 

It looks like this.

 

Dim app As Inventor.Application = ThisApplication
M1 = MessageBox.Show("Vill du checka in alla öppna filer?", "Vault Check-in", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If M1 = vbYes Then
		
		Dim oDoc As Inventor.Document
				For Each oDoc In ThisApplication.Documents.VisibleDocuments
						oDoc.Activate()
						saveCmd = app.CommandManager.ControlDefinitions("AppFileSaveCmd")
						saveCmd.Execute
					MessageBox.Show(oDoc.DisplayName)
					"Line for debuggind purposes"
					MessageBox.Show(ThisApplication.ActiveDocument.Displayname)
					"Line for debuggind purposes"
			
						ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(True)
				Next 
				MessageBox.Show("Vault Check-in klar", "Vault Check-in")
		End If
	Return

 I cant get it to work as intended. 

 

Will someone please have a look?

 

Best Regards

Alex

0 Likes
Reply
275 Views
2 Replies
Replies (2)

Jacob__with__a__k
Enthusiast
Enthusiast

not seeing any mistakes at first sight

one difference with my code: I'm using ".execute2(False)" (not that it should matter)

ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)
System.Windows.Forms.SendKeys.SendWait(CommentBox & Chr(9) & vbCrLf)

when I'm using my version of this (on 5 ish open drawings) it sometimes fails on half of the drawings, I too would love a stable solution to this

 

Currently I'm waiting for our upgrade to inventor 2024 to use the new functions, hopefully those work better 🙂

0 Likes

alexander.duell
Contributor
Contributor

Hello,

 

Thank you for answering,

 

That is the problem. I have a set of a coulpe IPT, IAM and IDW's

 

And it fails on some of teh IDW's, and i cant figure out why. As you, I do look for  stable and proof solution to this.

 

Best Regards,

Alex

0 Likes