Property watchers are used to set property values or domain lists based on input from a different property. In this example, property watchers are being used to add the values of two properties together to compute the value for a third property.
As shown by the Place Widget dialog, the value of Combined_Property is the sum of Property_A and Property_B.
To do this, create the three properties shown above and define a Property Watcher for Property_A and Property_B as shown.
Name: A descritptive name
Type: SynchItem - This type of watcher is used to establish relationships between different feature properties. If a match value is provided, the current property’s value must equal this value for the watcher to execute.
Feature: The name of the feature that will be updated
Property: The property of the feature that will be updated
Value Type: expressionEvaluator - Evaluates an expression specified in the Value column by using the MicroStation Expression Evaluator.
Value To Set: Widget.RootFeatureProperties.Property_A+Widget.RootFeatureProperties.Property_B
Redraw Watcher: Enabled - This redraws the item associated with the property being changed. It's used to change the enabled state of a dialog item and/or to reload the list of values.
Set Computed_Property to read-only. In the Initial Values section, create a new key for Read. Note that this value is not available in the interface and must be keyed in. Read is used when a feature is read from the design file.
Set the following for Read and Placing:
ValueType: expressionEvaluator
Value: Widget.RootFeatureProperties.Property_A+Widget.RootFeatureProperties.Property_B
Note:
Ensure that properties on which calculations are based, actually have values. You can use Initial Values to assign a default value for the placing key.
Note: The Data Browser does not support Property Watchers therefore you will not be able to make any changes or edits to the values by using the Data Browser.
For more information, please refer to:
Expressions, Operators and Basic Functions
Attached is a sample schema you can use for testing:
Property Watcher for Computed Value.zip