iLogicVault.UpdateVaultFileProperties() Not Updating .dwg Properties

iLogicVault.UpdateVaultFileProperties() Not Updating .dwg Properties

River.EngumYTTWH
Enthusiast Enthusiast
648 Views
6 Replies
Message 1 of 7

iLogicVault.UpdateVaultFileProperties() Not Updating .dwg Properties

River.EngumYTTWH
Enthusiast
Enthusiast

Hopefully I have some silly mistake on my hands as I'm sure .UpdateVaultFileProperties() should be working for .dwgs of others.

When attempting to update vault file properties of a .dwg, it shows a Property Edit version being created, but doesn't actually change any properties. The same code works perfectly for .ipt's and .iam's.

This is some simple code I put together to isolate this from my larger project, changing the vault path and property names should allow easy replication.

 

This also does not work when using the sample code to attempt to change properties from Inventor.

 

After some testing, I think this is due to the "Classification" property. I seem to be able to use the function to update .dwgs that have a Classification of None. I am unable to update properties of .dwgs with the Classification of Design Document.

 

My rough testing code: 

Sub iLogicMethod()
	vaultName 			= "$/Engineering/CC-LMS/_Users/River Engum/Vault Testing/lc test.dwg"
	vaultNameIam 		= "$/Engineering/CC-LMS/_Users/River Engum/Vault Testing/lc test.iam"
	
	Dim propDict As New Dictionary(Of String, Object)
	propDict.Add("ECN", "ECN Test")
	propDict.Add("Description", "desc test")
	For Each key As String In propDict.Keys
	    Logger.Info(key & ": " & propDict(key))
	Next
	
	Dim getLatest As Boolean = False
	'Logger.Info("getLatest: " & getLatest)
	
	updated = iLogicVault.UpdateVaultFileProperties(vaultName	, propDict, getLatest)
	updated = iLogicVault.UpdateVaultFileProperties(vaultNameIam, propDict, getLatest)
	
	If Not updated Then 
		Logger.Error("Updated: " & updated)
	Else
		Logger.Info("Updated Vault File Properties: " & Now())
	End If
End Sub

 

Autodesk Sample Code:

'DISCLAIMER:
'---------------------------------
'In any case, this solution's code, templates, and snippets are of "work in progress" character.
'Autodesk does Not represent that these samples are reliable, accurate, complete, Or otherwise valid For production usage. 
'Accordingly, those configuration samples are provided “as is” with no warranty of any kind, and you use the applications at your own risk.

Sub Main

	'Validate user's login state; it is optional as iLogicVault methods throw an exception with message 'Please log in to Vault before using this function'.
	If iLogicVault.LoggedIn = False
		Logger.Error("Not Logged In to Vault! - Login first and repeat executing this rule.")
		Exit Sub
	End If

	'Build one to many name/value pairs of Property/Value; note the value has to be of the expected type like string (text), decimal (numbers), date (date/time), or boolean (true/false)
	Dim mPropNameValueMap As New Dictionary(Of String, Object) 'add UDP.DisplayName, UDP.Value object of matching type
	mPropNameValueMap.Add("Title", "Property Edit at " + Date.Now.ToString)
	Dim mDate As Date = Date.Now
	mPropNameValueMap.Add("Checked Date", mDate)
	Dim mNum As Decimal = 15.6
	mPropNameValueMap.Add("Cost", mNum)
	Dim mBool As Boolean = True
	mPropNameValueMap.Add("MBD", mBool) 'Note - Vault UDP of type Bool must not have "Indeterminate" state; set the default value to True/False

	'we need the file's path in Vault; you can convert the local file path to the corresponding Vault virtual path
	Dim mVaultFileName As String = iLogicVault.ConvertLocalPathToVaultPath(ThisDoc.Path) + "/" + ThisDoc.FileName(True)

	'Retrieve the active document's Vault file status as name/value pairs 
	Dim mDocVaultStatus As New Dictionary(Of String, String)
	mDocVaultStatus = iLogicVault.GetVaultFileStatus(ThisDoc.PathAndFileName(True))
	If mDocVaultStatus.Item("ErrorState") = "None" And Not mDocVaultStatus.Item("CheckOutState") <> "NotCheckedOut" Or mDocVaultStatus.Item("LockState") <> "Unlocked" Then
		Dim success As Boolean = iLogicVault.UpdateVaultFileProperties(mVaultFileName, mPropNameValueMap)
		success = iLogicVault.UpdateVaultFileProperties(mVaultFileName, mPropNameValueMap)
		If success = False Then
			Logger.Error("Update Properties failed; either the file does not exist at the given full file name/path or is not available for check out.")
		Else
			Logger.Info("Successfully updated properties of file :" & mVaultFileName)
			'refresh the Vault Browser
			oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("VaultRefresh")
			oControlDef.Execute2(True)
		End If
	Else
		Logger.Error("Could not start to update the properties; check the status info below:")
		Logger.Info("CheckOutState = " + mDocVaultStatus.Item("CheckOutState"))
		Logger.Info("ConsumableState = " + mDocVaultStatus.Item("ConsumableState"))
		Logger.Info("ErrorState = " + mDocVaultStatus.Item("ErrorState"))
		Logger.Info("LocalEditsState = " + mDocVaultStatus.Item("LocalEditsState"))
		Logger.Info("LockState = " + mDocVaultStatus.Item("LockState"))
		Logger.Info("RevisionState = " + mDocVaultStatus.Item("RevisionState"))
		Logger.Info("VersionState = " + mDocVaultStatus.Item("VersionState"))
	End If

End Sub

 

0 Likes
649 Views
6 Replies
Replies (6)
Message 2 of 7

ihayesjr
Community Manager
Community Manager

@River.EngumYTTWH 

Did you make sure that the properties you are trying to edit are assigned to the Design Documentation category in Vault?

Does your code change the value in the DWG but not show it when it gets into Vault?




Irvin Hayes Jr
Principal Product Manager
Autodesk, Inc.

Vault - Under the Hood Blog
0 Likes
Message 3 of 7

River.EngumYTTWH
Enthusiast
Enthusiast

See attached images That show the existence of the applicable properties in the .dwg. We are not using a Design Documentation category, both are in the same category. Regardless of category, the Description property should be ubiquitous.

 

The function "iLogicVault.UpdateVaultFileProperties()" is used to update properties in vault, not within the file. I'm not sure what your second question is asking. The code is attached above and below.

 

Revised Code for isolated testing:

Sub TestingCode()
	vaultName 			= "$/Engineering/CC-LMS/_Users/River Engum/Vault Testing/lc test.dwg"
	vaultNameIam 		= "$/Engineering/CC-LMS/_Users/River Engum/Vault Testing/lc test.iam"
	
	Dim propDict As New Dictionary(Of String, Object)
	propDict.Add("ECN", "ECN Test")
	propDict.Add("Description", "desc test")
	For Each key As String In propDict.Keys
	    Logger.Info(key & ": " & propDict(key))
	Next
	
	Dim getLatest As Boolean = False
	'Logger.Info("getLatest: " & getLatest)
	
	updatedDWG = iLogicVault.UpdateVaultFileProperties(vaultName	, propDict, getLatest)
	updatedIAM = iLogicVault.UpdateVaultFileProperties(vaultNameIam, propDict, getLatest)
	
	If Not updatedDWG Then 
		Logger.Error("Updated .dwg: " & updatedDWG)
	Else
		Logger.Info("Updated Vault File Properties: " & Now())
	End If
	
	If Not updatedIAM Then 
		Logger.Error("Updated .iam: " & updatedIAM)
	Else
		Logger.Info("Updated Vault File Properties: " & Now())
	End If
End Sub

 

0 Likes
Message 4 of 7

MjDeck
Autodesk
Autodesk

Hi @River.EngumYTTWH - Which version of Inventor and Vault are you using?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 5 of 7

River.EngumYTTWH
Enthusiast
Enthusiast

@MjDeck 

Autodesk Vault Professional 2025:

Build 30.4.28.0

2025.4 Update

 

Autodesk Inventor Professional 2025:

Build 356

Release 2025.3.2 - Date Mon 8/25/2025

Message 6 of 7

MjDeck
Autodesk
Autodesk

@River.EngumYTTWH - thanks. We've been able to reproduce the problem and we're looking at it.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 7 of 7

River.EngumYTTWH
Enthusiast
Enthusiast

@MjDeck - Thanks for the update. I have been in communication with someone in "Customer Technical Success" and allegedly this is a known issue "under the PDM Jira cases with their development team." They apparently cite “that there’s no way to distinguish between [Inv.dwg and ACAD.dwg files]." This is confusing to me as Vault has a property that should be accessible via the Vault API of “Provider”, returning “AutoCAD” or “Inventor DWG”.

 

The Customer Technical Success has since stepped away from this problem as it is "out of their hands." I would greatly appreciate anything you can do to fix this currently semi-functional feature.