Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault Check-in through Ilogic

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
bsnyderACLUW
4350 Views, 3 Replies

Vault Check-in through Ilogic

Hi everyone,

 

Through some research I have put together an Ilogic rule that will check in all files that are open in Inventor. so far it works really well with one exception. Periodically the rule will just stop when it runs into a presentation file. I cant for the life of me figure out why. I have tried creating a case that is Inventor file specific. IE: part, assembly, drawing, and presentation. below is the version of the code with out the case function. any help or insight with this would be greatly appreciated.

 

thanks,

M1 = MessageBox.Show("do you want to check in all open files?", "Vault Check-in", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If M1 = vbYes Then
	M2 = MessageBox.Show("This does not work for Presentation files ensure all Presentation files are saved and closed", "Vault Check-in", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop)
	If M2 = vbOK Then
		I1 = InputBox("Leave a Vault check-in comment bellow", "Vault Check-in", "ECR # ")
		If I1 = ok Then
		Return
		Else
			Q1 = MessageBox.Show("Have you saved all open files?","Vault Check-in", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2)
			If Q1 = vbYes Then 
				Dim oDoc As Inventor.Document
				For Each oDoc In ThisApplication.Documents.VisibleDocuments
						'envoke Check In dialogbox
						ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)
						'inputs user comment and selects ok
						System.Windows.Forms.SendKeys.SendWait(CommentBox & Chr(9) & vbCrLf)
						'closes active file
						ThisApplication.CommandManager.ControlDefinitions.Item("AppFileCloseCmd").Execute
				Next 
				MessageBox.Show("Vault Check-in Compleate!!!!", "Vault Check-in")
			Else
			MessageBox.Show("Save Them Files!!!!","Vault Check-in")
			End If 
		End If
	Else
		Return
	End If
Else
	Return
End If 
3 REPLIES 3
Message 2 of 4
bsnyderACLUW
in reply to: bsnyderACLUW

So I have figured out why this happens. It happens to not be related to the presentation files. instead it happens when a file is already checked in. This could happen if, say for instance, the rule checked in a drawing file while the part associated with that drawing is still open in the inventor environment. When it gets to this part file it will stop because the part file was checked in with with the drawing and cant execute the check-in command. Is there a way I can incorporate a skip feature when this occurs? 

Message 3 of 4

Maybe this will help ?

 

https://forums.autodesk.com/t5/inventor-customization/check-if-file-is-open-inuse-when-saving-as-pdf... 

 

Regards,

 

FINEt L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

Message 4 of 4

@FINET_Laurent 

 

Thank you for providing that link. I was able to find what I needed there. 

If anyone else could use this in there work space the final version of the code is bellow:

M1 = MessageBox.Show("Do you want to check in all open files?", "Vault Check-in", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If M1 = vbYes Then
		I1 = InputBox("Leave a Vault check-in comment bellow", "Vault Check-in", "ECR # ")
		If I1 = ok Then
		Return
		Else
			Q1 = MessageBox.Show("Have you saved all open files?","Vault Check-in", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2)
			If Q1 = vbYes Then 
				Dim oDoc As Inventor.Document
				For Each oDoc In ThisApplication.Documents.VisibleDocuments
						'envoke Check In dialogbox
						ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)
						On Error GoTo Exitearly
						'inputs user comment and selects ok
						System.Windows.Forms.SendKeys.SendWait(CommentBox & Chr(9) & vbCrLf)
						'closes active file
						ThisApplication.CommandManager.ControlDefinitions.Item("AppFileCloseCmd").Execute	
				Next 
				MessageBox.Show("Vault Check-in Compleate!!!!", "Vault Check-in")
			Else
			MessageBox.Show("Save Them Files!!!!","Vault Check-in")
			End If 
		End If
Else
	Return
End If 


Exitearly:
 If exists Then ThisApplication.CommandManager.ControlDefinitions.Item("AppFileCloseCmd").Execute

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report