You can specify a condition that applies to the entire style sheet. All individual rules declared in the style sheet apply only to the symbols that comply with the condition specified for the entire style sheet. 

  • If you specify a condition for the entire style sheet, ensure the style sheet is applied to the entire project, not a single view, for the condition to take effect.
  • Currently, the style sheet condition can only be created via the Textual Editor.

Creating a style sheet condition

To create a condition for an entire style sheet


  1. Open a style sheet in the Textual Editor.
  2. Within the body of the part definition of a style sheet, redefine the styleSheetCondition element inherited from the StyleSheet element and define it by the needed condition.
  3. Within the body of the condition, declare a ref item, then redefine the needed item and specify its values.

    The available ref items and their value types depend on the condition definition you are using. For a list of the condition definitions and their available ref items, see the Style sheet rule conditions table.

  4. You can now:
    1. Create rules for the style sheet.
      1. Specify a condition for a rule.
      2. Specify styles for a rule.
    2. Synchronize modifications and assess layout-sensitive changes.

part def NewStyleSheet :> DS_Styles::CoreStylesComponents::StyleSheet {
   part :>> styleSheetCondition : DS_Styles::CoreStylesComponents::Predicates::ByDiagramTypeCondition {  // style sheet condition targeting symbols by view definition
      ref item :>> diagramType = DS_Views::SymbolicViews::gv.metadata;  // the condition targets views defined by the General View view definition
   }
}