Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DataStandard List Values

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Marcel.Decressin
781 Views, 7 Replies

DataStandard List Values

Hello,

 

is it possible to get the List Values from Vault for DataStandard?

 

22-09-2014 23-33-06.jpg

 

Thank you 🙂

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Marcel.Decressin

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

Message 3 of 8
M_DECRESSIN
in reply to: Anonymous

Works perfect.

Thank you. 🙂
Message 4 of 8

Within Vault everything works perfect.
But this won't Work for Inventor. Is this even possible with Inventor or AutoCAD?

 

Thank you.

Message 5 of 8
Anonymous
in reply to: Marcel.Decressin

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

Message 6 of 8
Marcel.Decressin
in reply to: Anonymous

Sorry, but the last approach didn't work..

Here is what i have done.

 

Propertie in Vault:

1.jpg

 

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:

2.jpg

These are not the Values i have expected.

Can you help me?

Thanks 🙂

 

 

Message 7 of 8
Anonymous
in reply to: Marcel.Decressin

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

Message 8 of 8
Marcel.Decressin
in reply to: Anonymous

Yeah. Thank you. You made my day 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report