Check In dialog box: Need to have OK button selected as default - iLogic

Check In dialog box: Need to have OK button selected as default - iLogic

RoyWickrama_RWEI
Advisor Advisor
1,794 Views
8 Replies
Message 1 of 9

Check In dialog box: Need to have OK button selected as default - iLogic

RoyWickrama_RWEI
Advisor
Advisor

Check In - Dialogbox.JPG

iLogic code request!

 

Currently, OK is not selected. We handle so many documents that we never input data for comments. Therefore we would like OK button is already selected so that by pressing enter (like the dialog box for Save) the document will be checked in.

 

Request help. Currently, I use the code shown below:

Sub Main()
oCheckIN()

End Sub

Sub oCheckIN()

ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomallCmd").Execute
iLogicVb.UpdateWhenDone=True

'ThisDoc.Document.Save()
'
'ThisApplication.ActiveView.Fit
ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)

End Sub

 

 

Thanks.

 

0 Likes
1,795 Views
8 Replies
Replies (8)
Message 2 of 9

RoyWickrama_RWEI
Advisor
Advisor

I guess this should be the default from within Inventor with "Comments" can still be typed in optionally.

0 Likes
Message 3 of 9

Ktomberlin
Advocate
Advocate

If you add

 

System.Windows.Forms.SendKeys.Sendwait(Chr(9) & vbCrLf)

 It will complete the check in, but if you want a comment you either have to allow them to type the comment and hit tab and enter, or you could hard code it like

 

 

System.Windows.Forms.SendKeys.Sendwait("comment" & Chr(9) & vbCrLf)

Or get it as a string from somewhere else. 

0 Likes
Message 4 of 9

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the reply. I appreciate the coding.

 

'
'ThisApplication.ActiveView.Fit
ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomallCmd").Execute

'Check In dialogbox
ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(False)

'To send by pressing ENTER button.
System.Windows.Forms.SendKeys.Sendwait("comment" & Chr(9) & vbCrLf)

 

I tried with the coding as shown above: I still get it as shown below. Basically, I need to execute check-In by pressing the ENTER button. It makes faster checking the documents.

 

Check In Options.GIF

 

Request to fix - if you don't mind.

0 Likes
Message 5 of 9

Ktomberlin
Advocate
Advocate

What version of vault do you have? it looks like you need to have another tab to get to the "enter"

 

System.Windows.Forms.SendKeys.Sendwait(Chr(9) & "Checked In using Ilogic" & Char(9) & vbCrLf)

0 Likes
Message 6 of 9

RoyWickrama_RWEI
Advisor
Advisor

Thanks for the reply. I do with Vault Basic - 2015 and Autodesk Inventor Professional - 2015

 

Still, it des not check in when the ENTER button is pressed. The cursor keeps blinking in the Checking dialog box white text box. FYI, please.

0 Likes
Message 7 of 9

Ktomberlin
Advocate
Advocate

If you cut and paste my last post there was a typo in it, I had an "a" in the second Chr(9).  Its fixed below. The Chr(9) is = to tab so if your still only in the comments add another "& Chr(9)". 

 

System.Windows.Forms.SendKeys.Sendwait(Chr(9) & "Checked In using Ilogic" & Chr(9) & vbCrLf)

Message 8 of 9

RoyWickrama_RWEI
Advisor
Advisor

I tried several options. But, still I could not get this around. I feel like you are right: it needs a couple of TABS. So, the right combination of Chr(9)s is required.

 

Do you mind fixing the code below (it looks weired, because I tried several options hopelessly)

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomallCmd").Execute
ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(True)

System.Windows.Forms.SendKeys.Sendwait("comment" & Chr(9) & vbCrLf _
& vbCrLf & "comment" & Chr(9) _
& vbCrLf & "comment" & Chr(9) _
& vbCrLf & "" _
& vbCrLf & "comment" & Chr(9) & vbCrLf)

Thanks.

 

0 Likes
Message 9 of 9

bsnyderACLUW
Enthusiast
Enthusiast

I know this thread is old but this is what I have so far and it works well but I cannot get it to work for different types of files. I want this to run through everything I have open be it drawings, assemblies, and parts and check them all in. Does anyone know how to make this happen?

'comment prompt
CommentBox = InputBox("Leave a Vault check-in comment bellow", "Vault Check-in Comment", "Default Entry")

If CommentBox = ok Then
	
	Return
	
Else
	
	Dim oDoc As Inventor.Document
	For Each oDoc In ThisApplication.Documents.VisibleDocuments
	
				oDoc.Save
				'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
		Next 
		ThisApplication.CommandManager.ControlDefinitions.Item("AppFileCloseCmd").Execute

End If

MessageBox.Show("Vault Check-in Compleate", "Vault")
0 Likes