Operations work with methods to define the behavior of XFM features. An operation is similar to a MicroStation command except that operations have a special finish notification that allows many operations to be sequenced together to perform feature placement.
The following example illustrates how to use an operation property to show a feature property based on a criteria. For example, in the video below:
- The feature MyLine is selected for placement
- The placement dialog shows both Status and Code
- When Status is set to Existing, the Code property becomes available for data entry. Existing lines are shown in magenta
- When the Status is set to New, the Code property is not displayed, however the value 10010 is automatically set as a feature property. New lines are shown in green.
To accomplish this, a ComboBox property named Status is added to the Operation node of the MyLine feature:
The ComboBox Properties are edited:
- Store Last Value = Session - This property option defines how to store the last entered value. When set to session, the last value is stored in the DGN only for this session of OpenCities Map.
- Save Changes Key = placing - This defines the initial value key to use to save the current value when the item is changed.
- Command Type = keyin > activate method MyLine|Place - A key-in can be sent to MicroStation or a VBA event can be fired when a new selection is made. This can be used to change the placement type.
While dialogs are automaticall built for you when you insert the features placement metadata, it does not account for customized operations. For this reason, the MyLine placement dialog will need to be updated manually.
Choose Dialogs > Place MyLine.
In the Dialog Items pane, choose Insert > Operation Item . This will insert a new dialogItem row above the selected row.
In the Dialog Items pane, set the Property to the name of the property to add to the dialog. In this example, it's Status. The Property specifies the name of property that will be set and that holds the dialog item specification.
In the Item Detail pane, set the Operation to the name of the feature or feature collection. This is the operation name used to search the operations cache for the property. In this example, it's MyLine.
The last item to change is to add a compare criteria on the Code dialog item which instructs it to only show up when the Status is set to Existing. The syntax for Compare criteria is:
COMPARE("[feature_instance_alias:property_name]", "compareValue", "") - Compare a feature's property value as a string to the string value "compareValue"
COMPARE("[feature_instance_alias:property_name]", "allow1|allow2|allow3", "|") - Compare a feature's property value as a string to see if it exists in the list of strings delimited by the "|" character
COMPARE("[operation_name/property_name]", "compareValue", "") - Compare an operation's property value as a string to the string value "compareValue"
COMPARE("[operation_name/property_name]", "allow1|allow2|allow3", "|") - Compare an operation's property value as a string to see if it exists in the list of strings delimited by the "|" character
In this example, the compare expression is: COMPARE ("[MyLine/Status]","Existing","") which compares the operation property Status value as a string value Existing.
- Since the Status property is only being used to show/hide the Code property. It is not written to the feature. This is shown by reviewing the feature properties by with Anaylze Feature.
- Likewise, you can't use the Status property with a criteria to set property based symbology.
- The initial value for Code is set to 10010.
- This article is based on the following discussion post: https://communities.bentley.com/products/geospatial/desktop/f/bentley-map-forum/83169/problem-with-criteria
A sample OpenCities Map CONNECT Edition XML is provided for your learning: