VDS: Manipulating Properties with Powershell makes category disapear

VDS: Manipulating Properties with Powershell makes category disapear

Anonymous
Not applicable
674 Views
2 Replies
Message 1 of 3

VDS: Manipulating Properties with Powershell makes category disapear

Anonymous
Not applicable

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?

 

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

Markus.Koechl
Autodesk
Autodesk
Accepted solution

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
Not applicable

Marvelous, thank you!

0 Likes