Have anybody gotten the Vault Check-in snippet to work?

Have anybody gotten the Vault Check-in snippet to work?

fridtjofZM5ME
Collaborator Collaborator
644 Views
4 Replies
Message 1 of 5

Have anybody gotten the Vault Check-in snippet to work?

fridtjofZM5ME
Collaborator
Collaborator

The following snippet comes with the R2024 installation, but when I try to run it it does absolutely nothing. No errors, no nothing. Anybody got any good ideas of how to make it work?

Sub CheckIn()
	Try
		ThisDoc.Save
		Dim oControlDef As Inventor.ControlDefinition
		oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop")
		oControlDef.Execute2(True)
	Catch ex As Exception
		Logger.Error("Undo Check-In failed; likely, the file wasn't checked out.")
	End Try
End Sub
0 Likes
645 Views
4 Replies
Replies (4)
Message 2 of 5

Curtis_Waguespack
Consultant
Consultant

Hi @fridtjofZM5ME 

 

I don't think so. 

 

What version of Inventor are you using?

 

If you are using Inventor 2024 there are built in ilogic Vault functions:

https://www.youtube.com/watch?v=6-GNaoGu40w

 

If using Inventor 2020 to 2023 see this link:

https://www.autodesk.com/autodesk-university/class/iLogic-and-Vault-Vault-and-iLogic-2020

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 5

fridtjofZM5ME
Collaborator
Collaborator

Yes, this is the 2024 release of both programs, and the above code is from the built-in snippets.

 

It would appear after posting this that it might be a Vault issue with the add-in not loading properly or something like that.

Message 4 of 5

JelteDeJong
Mentor
Mentor

I did not like some of the snippets in the first release of Inventor 2024. Im not sure if they have already released some better snippets. Anyway, have a look at this slightly altered version of the snippet:

Try
	ThisDoc.Save
	Dim oControlDef As Inventor.ControlDefinition
	oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop")
	oControlDef.Execute2(True)
Catch ex As Exception
	MsgBox("Check-In failed; likely, the file wasn't checked out.")
End Try

it should at least show a message box telling you that it did not work.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 5

Martin-Winkler-Consulting
Advisor
Advisor

Hi, i am using this class in VB.Net. (not checked with IV2024)
May be it is usefull for you.

Public Class Vault_Inventor_Addin

#Region "Fields & Properties"
    Private m_ctrDefs As ControlDefinitions
    Private m_ctrDef As ControlDefinition
    Private m_doc As Document
    Private m_VaultAddin As Boolean = False
#End Region

#Region "Konstruktor"
    Public Sub New(oDoc As Document)
        m_doc = oDoc
        m_ctrDefs = InventorApp.CommandManager.ControlDefinitions
        If InventorApp.ApplicationAddIns.ItemById("{48B682BC-42E6-4953-84C5-3D253B52E77B}").Activated Then
            m_VaultAddin = True
        End If
    End Sub
#End Region

#Region "Vault Commands"
    Public Sub Vault_Check_In()
        If m_VaultAddin Then
            'Einchecken aktuelles Dokument
            m_doc.Save()
            m_ctrDef = m_ctrDefs.Item("VaultCheckinTop")
            If Not m_ctrDef Is Nothing Then
                m_ctrDef.Execute()
            End If
        End If
    End Sub
    Public Sub Vault_Check_Out()
        If m_VaultAddin Then
            'Auschecken aktuelles Dokument
            m_ctrDef = m_ctrDefs.Item("VaultCheckoutTop")
            If Not m_ctrDef Is Nothing Then
                m_ctrDef.Execute()
            End If
        End If
    End Sub
    Sub Vault_Get_Latest()
        If m_VaultAddin Then
            'Ruft letzte Version ab
            m_ctrDef = m_ctrDefs.Item("VaultGetLatest")
            If Not m_ctrDef Is Nothing Then
                m_ctrDef.Execute()
            End If
        End If
    End Sub
    Sub Vault_Refresh()
        If m_VaultAddin Then
            'Dokument aktualisieren
            m_ctrDef = m_ctrDefs.Item("VaultRefresh")
            If Not m_ctrDef Is Nothing Then
                m_ctrDef.Execute()
            End If
        End If
    End Sub
    Sub Vault_Launch_Explorer()
        If m_VaultAddin Then
            m_ctrDef = m_ctrDefs.Item("VaultLaunchVaultExplorer")
            If Not m_ctrDef Is Nothing Then
                m_ctrDef.Execute()
            End If
        End If
    End Sub
#End Region
End Class

Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature