Conditions and Filters

Conditional logic can be used to filter the content that is returned from the execution of a Query Definition. Where Conditions on the Query Items are used to add conditional logic. For example, the following Where Condition, applied to a related Part Item, results in only those Parts with the String ‘valve’ included somewhere in the Part Name being included in the query results.

Note
Properties used in Condition statements should be included with the Query Item. For example, the Name Property would need to be included with the Part Query Item for it to apply in this condition. Note also that the example in above figure will only filter Part Items, the Part CAD relationship Items will still be included in the query results.

Warning
Federated Properties cannot be used in a Where Condition.

Conditional logic applied to any ItemType that is added to the Base Query Items can be done without affecting the Dynamic Viewer or Streaming Viewer. However, Administrators must use caution when applying conditions to the Query Items that are part of the Base Query Definition. For this purpose, the following information should be referenced:

  1. Conditions that filter an assembly will result in all descendant CAD Items being filtered.
  2. It is possible to filter CAD Items based on conditions applied to related content. For example, to filter component CAD Items based on conditions applied to related Parts:
    • The Condition applied to the Part Query Item can be whatever logic is necessary to isolate specific Part Items.
    • The Condition applied to the Part CAD Query Item uses the ‘Exists()’ function. This function effectively applies a SQL Inner Join between the Part CAD and Part Tables. The result is the rows for the Part CAD Items are reduced to only those with related Part rows in this case. That is, only Part CAD Items are returned if there are related Part Items returned which are filtered by some logic.
    • The Condition applied to the CAD Query Item needs to only associate the related part filter to CAD Items that represent components (non-Assembly Items). To do this, include the condition on the existence of the Part CAD Items. If a row is included, then include the CAD Item as well.
    • Warning
      Federated Properties cannot be used in Where Conditions.

  3. Use caution when applying filters to CAD Query Items. They are reused and exist to execute recursive sub-queries. In this case, the CAD Query Item represents both Assemblies and Components. Applied Conditional logic needs to consider that when Parts in a Dynamic View are placed, they require the application of the full lineage of Transformations from the root CAD Item to each leaf Component CAD Item.
  4. If Conditions are applied to CAD Instance Query Items, instances of the related CAD Item are also filtered.
  5. The Base Query Definition has a Condition that filters the File Item (view file) related by a File Representation based on the Representation ‘kind’; which is SCS. If this Condition is modified, it may result in the corresponding 3D geometry being removed.