Hello,
is it possible to get the List Values from Vault for DataStandard?
Thank you 🙂
Solved! Go to Solution.
Hi Marcel,
Yes you can get the listvalues. You have to add the following to your combobox in your xaml file:
ItemsSource="{Binding Prop[BenutzerStatus].ListValues}"
So you will get something like the following:
<ComboBox ItemsSource="{Binding Prop[BenutzerStatus].ListValues}" Name="BenutzerStatus" Text="{Binding Prop[BenutzerStatus].Value}"/>
Regards,
Peter
Within Vault everything works perfect.
But this won't Work for Inventor. Is this even possible with Inventor or AutoCAD?
Thank you.
Hi Marcel,
In Inventor and AutoCAD you have to use another approach.
Within your default.PS1 (located in C:\ProgramData\Autodesk\Vault 2015\Extensions\DataStandard\CAD\addins) , you have to add a function that grabs the listvalues defined in vault:
function GetBenutzerStatusList { $PropDefs = $vault.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE") $PropID = @() $PropDefs | ForEach-Object { if($_.DispName -eq "BenutzerStatus") { $ID += $_.Id }} $PropDefInfo = $vault.PropertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", $PropID) $BenutzerStatusList = @() $BenutzerStatusList = $PropDefInfo[0].ListValArray return $BenutzerStatus }
In your Xaml File you can use this function:
<ComboBox ItemsSource="{Binding PsList[GetBenutzerStatusList]}" Name="BenutzerStatus" Text="{Binding Prop[BenutzerStatus].Value}"/>
Hope this helps.
Regards,
Peter
Sorry, but the last approach didn't work..
Here is what i have done.
Propertie in Vault:
XAML Code:
<ComboBox x:Name="CMB_Fertigung" ItemsSource="{Binding PsList[GetBenutzerStatusList]}" Text="{Binding Prop[BenutzerStatus].Value}"/>
PowerShell Code:
function GetBenutzerStatusList { $PropDefs = $vault.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE") $PropID = @() $PropDefs | ForEach-Object { if($_.DispName -eq "BenutzerStatus") { $ID += $_.Id }} $PropDefInfo = $vault.PropertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", $PropID) $BenutzerStatusList = @() $BenutzerStatusList = $PropDefInfo[0].ListValArray return $BenutzerStatusList }
And this is the Resault within Inventor:
These are not the Values i have expected.
Can you help me?
Thanks 🙂
Hello Marcel,
I see that there I have made a little mistake in my code. You need to modify the next line:
$PropDefs | ForEach-Object { if($_.DispName -eq "BenutzerStatus") { $ID += $_.Id }}
To:
$PropDefs | ForEach-Object { if($_.DispName -eq "BenutzerStatus") { $PropID += $_.Id }}
This should work.
Regards,
Peter