<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: get vault folder properties in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12440442#M161489</link>
    <description>&lt;P&gt;Would you please elaborate on your answer, if possible? I have access to the VaultSDK.chm file too.&lt;/P&gt;&lt;P&gt;This is what I'm using to get the current lifecyclestate of a file.&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;AddReference "Autodesk.Connectivity.WebServices.dll"
Imports AWS = Autodesk.Connectivity.WebServices
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
AddReference "Connectivity.Application.VaultBase.dll"
Imports VB = Connectivity.Application.VaultBase


Sub Main()
	Dim paras As Parameters
	Dim para As Parameter
	Dim propsets As PropertySets
	Dim doc As Document = ThisDoc.Document

		Dim mVltCon As VDF.Vault.Currency.Connections.Connection
		mVltCon = VB.ConnectionManager.Instance.Connection
		If  mVltCon Is Nothing Then
		     MsgBox("Not logged in to Vault" )
		     Exit Sub
		End If
		
		MsgBox(get_vaultfilestatus(doc.FullFileName, mVltCon))
			
	
End Sub

Function get_vaultfilestatus(filepath As String, vaultconnection As VDF.Vault.Currency.Connections.Connection) As String
	
	
	filepath = filepath.Replace("C:\xx\", "$/")
	'flip the slashes
	filepath = filepath.Replace("\", "/")
	
	Dim VaultPaths() As String = New String() {filepath}
	 
	Dim wsFiels() As AWS.File = vaultconnection.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
	 
	Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(conn,wsFiels(0))
	Dim lifeCycleInfo As VDF.Vault.Currency.Entities.FileLifecycleInfo = mFileIt.LifecycleInfo
	
	Return lifeCycleInfo.StateName
	'MessageBox.Show(lifeCycleInfo.StateName)
End Function
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 06:36:29 GMT</pubDate>
    <dc:creator>richterBKSAC</dc:creator>
    <dc:date>2023-12-14T06:36:29Z</dc:date>
    <item>
      <title>get vault folder properties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12438361#M161440</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to access/get the vault properties of the folder + parent folder of an idw, located in the folder, currently openend in Inventor via ilogic.&lt;/P&gt;&lt;P&gt;I've found other posts about similar topics, like getting the lifecyclestatus, but I can't manage to rebuild them to do what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much apprecciated.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 11:23:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12438361#M161440</guid>
      <dc:creator>richterBKSAC</dc:creator>
      <dc:date>2023-12-13T11:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: get vault folder properties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12439583#M161485</link>
      <description>Lifecyclestatus or statehistorical</description>
      <pubDate>Wed, 13 Dec 2023 19:53:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12439583#M161485</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-12-13T19:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: get vault folder properties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12440442#M161489</link>
      <description>&lt;P&gt;Would you please elaborate on your answer, if possible? I have access to the VaultSDK.chm file too.&lt;/P&gt;&lt;P&gt;This is what I'm using to get the current lifecyclestate of a file.&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;AddReference "Autodesk.Connectivity.WebServices.dll"
Imports AWS = Autodesk.Connectivity.WebServices
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
AddReference "Connectivity.Application.VaultBase.dll"
Imports VB = Connectivity.Application.VaultBase


Sub Main()
	Dim paras As Parameters
	Dim para As Parameter
	Dim propsets As PropertySets
	Dim doc As Document = ThisDoc.Document

		Dim mVltCon As VDF.Vault.Currency.Connections.Connection
		mVltCon = VB.ConnectionManager.Instance.Connection
		If  mVltCon Is Nothing Then
		     MsgBox("Not logged in to Vault" )
		     Exit Sub
		End If
		
		MsgBox(get_vaultfilestatus(doc.FullFileName, mVltCon))
			
	
End Sub

Function get_vaultfilestatus(filepath As String, vaultconnection As VDF.Vault.Currency.Connections.Connection) As String
	
	
	filepath = filepath.Replace("C:\xx\", "$/")
	'flip the slashes
	filepath = filepath.Replace("\", "/")
	
	Dim VaultPaths() As String = New String() {filepath}
	 
	Dim wsFiels() As AWS.File = vaultconnection.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
	 
	Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(conn,wsFiels(0))
	Dim lifeCycleInfo As VDF.Vault.Currency.Entities.FileLifecycleInfo = mFileIt.LifecycleInfo
	
	Return lifeCycleInfo.StateName
	'MessageBox.Show(lifeCycleInfo.StateName)
End Function
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 06:36:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12440442#M161489</guid>
      <dc:creator>richterBKSAC</dc:creator>
      <dc:date>2023-12-14T06:36:29Z</dc:date>
    </item>
    <item>
      <title>Betreff: get vault folder properties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12440580#M161495</link>
      <description>&lt;P&gt;I've been digging a little in the&amp;nbsp;&lt;SPAN&gt;VaultSDK.chm file and found a possible route, although I don't know to put it into code yet. Maybe someone could tell me if this route would be possible and/or provide some code.&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;get the entityID of the active Inventor file&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;get the FolderID of the parent folder (from the file class)&lt;/SPAN&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;use GetPropertiesByEntityIds (PropertyService class) to get the desired property values&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;get the ParID with the FolderID (Folder class) to get the ID of the folder above the current folder&lt;/SPAN&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;repeat step 2.1&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 08:27:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12440580#M161495</guid>
      <dc:creator>richterBKSAC</dc:creator>
      <dc:date>2023-12-14T08:27:22Z</dc:date>
    </item>
    <item>
      <title>Betreff: get vault folder properties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12452631#M161781</link>
      <description>&lt;P&gt;For future users, here is how I managed to get the property value of a vault property attached to a folder in vault.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;AddReference "Autodesk.Connectivity.WebServices.dll"
Imports AWS = Autodesk.Connectivity.WebServices
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
AddReference "Connectivity.Application.VaultBase.dll"
Imports VB = Connectivity.Application.VaultBase
AddVbFile "iLogic_Basis.vb"

Sub Main()
	Dim doc As Document = ThisDoc.Document

	'Vault Connection
	Dim mVltCon As VDF.Vault.Currency.Connections.Connection
	mVltCon = VB.ConnectionManager.Instance.Connection
	If  mVltCon Is Nothing Then
	     MsgBox("Not logged into Vault",,"Error" )
	     Exit Sub
	End If
	'insert the property name as string	
	vault_get_folder_prop(doc.FullFileName, mVltCon, "yourPropertyName")
	
End Sub

Function vault_get_folder_prop(filepath As String, vaultconnection As VDF.Vault.Currency.Connections.Connection, propname As String) As String

	'complete the path to your local vault working directory
	filepath = filepath.Replace("C:\XX\", "$/")
	'flip the slashes
	filepath = filepath.Replace("\", "/")
	
	Dim VaultPaths() As String = New String() {filepath}
	
	Dim wsFiles() As AWS.File = vaultconnection.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
	Dim mFileIt As AWS.File = New VDF.Vault.Currency.Entities.FileIteration(conn, wsFiles(0))
	'get the folder ID of the folder your currently opened Inventor file is located in
	Dim folderid As Long = mFileIt.FolderId

	'get the property definition ID of your desired property
	Dim pdefs() As AWS.PropDef = vaultconnection.WebServiceManager.PropertyService.GetPropertyDefinitionsByEntityClassId("FLDR")
	Dim propdef_ID As Long
	For Each propdef In pdefs
		If propdef.DispName = propname Then
			propdef_ID = propdef.Id
		End If
	Next
	
	'get the property value of your desired property
	Dim propValues As AWS.PropInst() = vaultconnection.WebServiceManager.PropertyService.GetProperties("FLDR", New Long(){folderid},New Long(){propdef_ID})
	Dim propValue As String = DirectCast(propValues(0).Val, String)
	Return propValue

End Function&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Dec 2023 07:19:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-vault-folder-properties/m-p/12452631#M161781</guid>
      <dc:creator>richterBKSAC</dc:creator>
      <dc:date>2023-12-20T07:19:27Z</dc:date>
    </item>
  </channel>
</rss>

