user define property update using C#

user define property update using C#

Anonymous
Not applicable
465 Views
2 Replies
Message 1 of 3

user define property update using C#

Anonymous
Not applicable

How can I edit and update a user define property using c# programing. basically i have this UDP named usercomment and i want to update its description using C# codes. can someone help me with this?

0 Likes
466 Views
2 Replies
Replies (2)
Message 2 of 3

Markus.Koechl
Autodesk
Autodesk

If you need to update properties only, this code snippet might help (updates the "Part Number"): 

                Dictionary<ACW.PropDef, object> mPropDictonary = new Dictionary<ACW.PropDef, object>();

                ACW.PropDef[] propDefs = conn.WebServiceManager.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE");
                ACW.PropDef propDef = propDefs.SingleOrDefault(n => n.SysName == "PartNumber");
                mPropDictonary.Add(propDef, mNewNumber);

                UpdateFileProperties((ACW.File)mFileIt, mPropDictonary);

If you need to check out, edit geometry, and check in a file, you can submit the comment within the check-in command like this: 

mUploadedFile = conn.FileManager.CheckinFile(results.FileResults.First().File, "Created by iLogic-Vault rule", false, null, null, false, null, ACW.FileClassification.None, false, vdfPath);

 

You can review the context of both snippets here: https://github.com/koechlm/iLogic-Vault/blob/2022/iLogic-Vault-QuickstartLibrary/iLogic-Vault%20Quic...

 

I hope this helps. 



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 3

Anonymous
Not applicable

After update vault 2022.2 the function

 

UpdateFileProperties((ACW.File)mFileIt, mPropDictonary);

 

doesn't work. Is the any information about changing in this function ?

 

Thx

Torsten

0 Likes