Vault Check in Comments Code

Vault Check in Comments Code

Anonymous
Not applicable
895 Views
3 Replies
Message 1 of 4

Vault Check in Comments Code

Anonymous
Not applicable

I'm not sure if what I'm trying to do it possible, but it is something that would be very useful.

 

At the moment we fill put our changes to models/drawings in the "Comments" (iProperties) bit, and when checking into vault we fill in the comments on check in with exactly the same comments. So far I've written a little bit of code that when run opens the check in box and fills the comments box with the property comments.

 

This however isn't really what I want. I want to check the drawing/ model in normally and have the box filled in as if I'd run my code.

 

Sub VaultCheckIn()
 
    Dim invDoc As Document
    Set invDoc = ThisApplication.ActiveEditDocument
    Dim invSummaryInfo As PropertySet
    Set invSummaryInfo = invDoc.PropertySets.Item("Inventor Summary Information")
    Dim oComment As String
    oComment = invSummaryInfo("Comments").Value
 
    On Error Resume Next
    invDoc.Save2
 
    Set ctrdef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckInTop")
 
    ctrdef.Execute2 False
 
    SendKeys oComment & "{TAB}"
End Sub
 
 
Anyone know anything about this? 🙂
Thank you!
0 Likes
896 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

No replies.. so I have another question. Using the code below works just fine to check something in, until the file has the same name as a file already in Vault. This doesn't happen to often but is very confusing when it does because simply nothing happens. Is there a way to check vault for a file in the background and then produce an error message if it's found?

0 Likes
Message 3 of 4

Anonymous
Not applicable

An unusual thing I noticed was it come up with the error saying 'Already in Vault' when I use F8 but only occasionally when I run it?!

0 Likes
Message 4 of 4

Anonymous
Not applicable

does anyone know how to get around this?

When I run the code, if the file isn't in vault it works fine. When the file is  in vault it stops after the execute2 false.

If I don't use send keys it gives me an error like it should do saying the file is already in vault, but of course now I don't have to comments which is the main point. If I don't use the execute2 false it wont place the send keys in the right bit!

 

Sub VaultCheckIn()

Dim invDoc As Document
Set invDoc = ThisApplication.ActiveEditDocument
Dim invSummaryInfo As PropertySet
Set invSummaryInfo = invDoc.PropertySets.Item("Inventor Summary Information")
Dim oComment As String
If invSummaryInfo("Comments").Value = "" Then
oComment = "1st CHECK IN"
Else
oComment = invSummaryInfo("Comments").Value
End If

Set ctrdef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop")
ctrdef.Execute2 False

SendKeys (oComment), 0.1
DoEvents
'SendKeys "{TAB}"

End Sub

 

 

 

0 Likes