Inventor DataStandard - Property Validation

Inventor DataStandard - Property Validation

d_stockinger
Enthusiast Enthusiast
403 Views
4 Replies
Message 1 of 5

Inventor DataStandard - Property Validation

d_stockinger
Enthusiast
Enthusiast

Hello,

 

I have a configuration, where a Property is required for one Category, but not for the other one. 

Here is a ScreenShot from the Configuration of the Property.

dstockinger_2-1673946210611.png

 

the default Configuration from DataStandard Inventor.xaml wos adopted with WPF:ValidateBinding:

 

<TextBox x:Name="txtComments" Grid.Column="1" Grid.Row="4" TextWrapping="Wrap" Text="{WPF:ValidatedBinding Prop[Comments].Value}" BorderThickness="0,1,1,1"
VerticalContentAlignment="Top" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Height="50" />

 

The RedFrame always appears around the TextBox, but the DynamicGrid RedFrame for the property appears only for one of the selected category.

dstockinger_1-1673946167403.png

 

dstockinger_0-1673946133739.png

 

How can this be achived for the TextBox?

 

 

Many Thanks


BestRegards
Daniel

0 Likes
Accepted solutions (1)
404 Views
4 Replies
Replies (4)
Message 2 of 5

Markus.Koechl
Autodesk
Autodesk

Hi Daniel,

to achieve this, I would leverage the custom validation capabilities for properties:

$Prop["PropName"].CustomValidation = { MyCustomValidation }
function MyCustomValidation
...

 See also the help documentation to extend this by tooltips/error messaging: https://help.autodesk.com/view/VAULT/2023/ENU/?guid=GUID-1FE5AF32-38BB-48D2-9E90-657AEF8F6063



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 5

d_stockinger
Enthusiast
Enthusiast

Hi Markus,

 

Thanks for your answer. 

 

I feared it. To do this, the category and the associated properties must be evaluated. Is there an example for this?

 

$Cat = $vault.CategoryService.GetCategoryById("24")

$CatDef = $vault.CategoryService.GetCategoryConfigurationById($Cat.Id, $String)

$CatDef.BhvCfgArray[0].BhvArray
 

What I'm still missing is finding out whether the property is a required field or not.

 

Many Thanks

Daniel

0 Likes
Message 4 of 5

Markus.Koechl
Autodesk
Autodesk
Accepted solution
Yes, you would need to evaluate the constraints for the given category. Use the Find() method of the PropertyDefinition.DefinitionConstraints class.
But why are you making all these efforts instead of leveraging the intelligent behavior of the dynamic grid?


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 5 of 5

d_stockinger
Enthusiast
Enthusiast

Hi Markus,

 

Thanks for you answer, and your suggestions. 

 

The issue is, that i have to prefill ComboBoxes and other Elemtens depending on ERP Classification.

 

Many Thanks
Daniel

0 Likes