Get 'List of Values' for Vault Property

Get 'List of Values' for Vault Property

ThomasRambach
Advisor Advisor
1,148 Views
2 Replies
Message 1 of 3

Get 'List of Values' for Vault Property

ThomasRambach
Advisor
Advisor

In Vault, you have the ability to provide a list of values for a property. Users then can pick from the list of values as the value of the property.

 

I can't find in the API a method to retrieve that list of values for a property. Is this possible?

0 Likes
Accepted solutions (1)
1,149 Views
2 Replies
Replies (2)
Message 2 of 3

woodstylee3
Advocate
Advocate
Accepted solution

OK hopefully this makes some sense:

 

So each PropDefInfo contains an Array of Constraints.

One of Which may be a EnforceListOfValues Constraint

Each EnforceListOfValues Constraint has a property ListValArray

which is the list vals

 

----------

 

so with prpdefifos =  PropDefInfo[]

 

 

var propconstraints = prpdefifos.SelectMany(x=> x.PropConstrArray);
if (propconstraints.Where(cst => cst.PropConstrTyp == Autodesk.Connectivity.WebServices.PropConstrTyp.EnforceListOfValues).Count() >0)
{
ArrayofVals =  prpdefifos.Where(x => x.ListValArray != null).First().ListValArray.Select(x => x.ToString()).ToArray()));
}

 

 

0 Likes
Message 3 of 3

ThomasRambach
Advisor
Advisor

Thanks @woodstylee3 

 

From your code, this was my result for just getting the list of acceptable values for a property called "Drawing Type":

                PropertyService PropSrvc = context.Connection.WebServiceManager.PropertyService;
                ACW.PropDef[] filePropDefs = mWsMgr.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE");
                PropDef drawingtypePropDef = filePropDefs.Single(n => n.DispName == "Drawing Type");
                ACW.PropDefInfo[] filePropDefInfo = mWsMgr.PropertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", new long[]{ drawingtypePropDef.Id });

                var arrayDrawingType = filePropDefInfo.Where(x => x.ListValArray != null).First().ListValArray.Select(x => x.ToString()).ToArray();
0 Likes