CONDITION - Intergraph Smart 3D - Reference Data

Intergraph Smart 3D Drawings and Reports Reference Data

Language
English
Product
Intergraph Smart 3D
Subproduct
Drawings and Reports
Search by Category
Reference Data
Smart 3D Version
12.1 (2019)

Allows you to specify conditional branches in the schema. You must specify at least one attribute that defines the condition for which to test, along with the CONDITION node. The CONDITION_DEFAULT node acts as a fallback for the condition if no conditions pass.

SHARED Tip CONDITION nodes behave like if statements in procedural programming languages. Likewise, CONDITION_DEFAULT nodes behave like else statements.

If multiple CONDITION statements are stacked, then each subsequent CONDITION behaves like an else if statement. For example:

  • <CONDITION case1="case1_value" case2="case2_value" … >value_for_first_condition</CONDITION>

  • <CONDITION case3="case3_value" case4="case4_value" … >value_for_second_condition</CONDITION>

  • <CONDITION_DEFAULT>fallback value</CONDITION_DEFAULT>

In the example below, the condition tests to see whether the DrawingLinearLeader module is the chosen leader module. If it is, the condition evaluates to 0.005. However, if the chosen leader module is not DrawingLinearLeader, the condition evaluates to 0.015.

<DEFAULT>
<CONDITION LEADER_MODULE="DrawingLinearLeader">
0.005</CONDITION>
<CONDITION_DEFAULT>0.015</CONDITION>
</DEFAULT>

In the previous example, the CONDITION and CONDITION_DEFAULT nodes fall within the <DEFAULT> section. This means that the value evaluated for the condition applies to the default value for the property.

Conditional statements can apply to entire properties, or to the CONTROL, POPULATE, and DEFAULT nodes.

The following table gives additional information about conditional statements.

CONDITION APPLIES TO

SCHEMA XML SYNTAX

NOTES

Entire property

The CONDITION node completely encloses the CONTROL node. As an example, see the delivered dimension property.

If the condition passes when the CONTROL node exists inside of a CONDITION node, then the Rule Manager displays the property. However, if the condition fails, then the Rule Manager does not display the property.

CONDITION_DEFAULT is not allowed as a conditional for an entire property.

CONTROL node

The CONTROL node completely encloses CONDITION and CONDITION_DEFAULT nodes. Currently, no delivered properties exhibit this behavior, though the schema does support it.

If the condition passes, then the Rule Manager displays a specific option, such as a drop-down, for editing. However, if the condition fails, then the software displays an alternate option for editing the property, such as a text box.

POPULATE node

The POPULATE node completely encloses CONDITION and CONDITION_DEFAULT nodes. As an example, see the delivered label property, orientation5.

The property uses a specified set of stored display values, as well as one default value for the display option, if the condition passes. However, if the condition fails, the property uses an alternate set of stored display values, as well as an alternate default value for the display option.

DEFAULT node

The DEFAULT node completely encloses CONDITION and CONDITION_DEFAULT nodes. See the delivered property hOffset as an example.

The property uses a specified default value for the property if the condition passes. However, if the condition fails, the property uses an alternate default value for the property.

Each case name in a condition is the name of a property in the Custom_DrawingLabelUIPropertiesCommon.xml schema file and in the Custom_DrawingDimensionUIPropertiesCommon.xml schema file. Therefore, you might see the following conditions:

  • Conditions for checking whether modules are set to certain values.

<CONDITION CONTENT_MODULE="DrawingWeldSymbols">

The .dll names of modules, not display names, appear in conditional statements.

  • Conditions for checking whether module properties are set to certain values.

<CONDITION placeLines="True">

Quoted values in conditional statements are always display values and not stored .xml values. For example, the line <CONDITION placeLines="True"> within the placeLinesOnSheet label property definition causes the software to display the placeLinesOnSheet property only when the placeLines property is selected in the Label Rule Manager. However, the line cannot read <CONDITION placeLines="-1"> because -1 is a stored value in the placeLines property definition and is not a display value.

AND/OR Syntax

The Boolean operators * (and) and | (or) allow you to join or exclude cases in a condition. The following example shows that the test value might contain these operators for each case in a condition.

<CONDITION case1="value1|value2|value3" case2="value4*value5">…</CONDITION>

In this instance, the condition checks whether case1 matches value1, value2, or value3. The condition also requires that case2 must match both value4 and value5.

  • If there is more than one case for a single CONDITION statement (for example, both case1 and case2, as above), all cases in that CONDITION node must pass for the condition to pass as a whole.

  • The schema allows only one type of Boolean operator within each case string. For example, case1="value1|value2|value3" is a valid string. On the other hand, case1="value1|value2*value3" is an invalid string.

NEGATION Syntax

The negation Boolean operator ! (exclamation point) displays as a prefix and indicates reversed Boolean logic. For example, the following schema example demonstrates the positioning module ISDwgPositionByCurve2D prefixed with the negation operator:

<CONDITION POSITIONING_MODULE="!ISDwgPositionByCurve2D">

The negation Boolean operator in the example above shows that the condition passes only if you have not chosen the ISDwgPositionByCurve2D positioning module.

You can join negation Boolean operators in the same case value. For example, you can specify the following condition:

<CONDITION case="!value1*!value2*!value3">…</CONDITION>

See Also

Label Rule Manager
Appendix: Annotation Rule Manager Customization
XML Structure for Property and Property Group Definitions