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: 

VDS: Manipulating Properties with Powershell makes category disapear

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
552 Views, 2 Replies

VDS: Manipulating Properties with Powershell makes category disapear

I would like to input some property values programmatically instead of typing them in. I added a button to the Inventor dialog:

 

<Button Content="SetProperties" Command="{Binding PsCmd[SetProperties]}" Grid.Column="1" Width="80"/>

I added the function updating a hardcoded property to a hardcoded value:

 

function SetProperties
{
	$Prop["Title"].Value = "test123"
}

This is of course pointless. Have some fantasy here: someday the function will fetch values from another system or something. It will still be okay if the user changes them after fetching. Think of it as a kind of recommendation.

 

It works, too. The button causes the GUI to be updated and the value will be saved to the iProperty:

 

Unbenannt.PNG

 

Unfortunately, it also murders the Category Property, which is set empty after I press my button (VDS_Category is empty after saving). So all is fine if I press first, choose category second. If I do it the other way round, I lose the Category. This is especially bothersome if I want to edit a file that has already been saved, since DataStandard will not let me switch the category in this case.

 

As far as I can see, VDS_Category is the only iProperty affected by this, all the others keep their values. Why is that?

 

2 REPLIES 2
Message 2 of 3
Markus.Koechl
in reply to: Anonymous

This is a known issue and should get solved in newer configuration defaults. Your action causes a full refresh of the UI and we need to prevent this for existing selections. Edit your XAML as documented in AKN article:

 

Search for ItemsSource="{Binding PsList[GetCategories]}"
Replace the binding as shown below: 
ItemsSource="{Binding PsList[GetCategories]}"

by 

ItemsSource="{Binding PsList[GetCategories], Mode=OneTime}"



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 3 of 3
Anonymous
in reply to: Markus.Koechl

Marvelous, thank you!

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

Post to forums  

Autodesk Design & Make Report