Query

You can search for multiple objects by using the Query function. Once the objects are matched or filtered, you can then perform a single action or multiple actions on the matched objects. For example, you can change the material on all the matched objects, and set a specific layer. You can apply these actions to the matched objects, and their children in the BOM, or alternatively, to only the matched objects.

Query functionality works with models of all sizes, but can be particularly useful when navigating extremely large models.

Queries can be loaded into the Query window from a text (.rhq) file. They are executed from the Query window, and the results displayed in the SAP Visual Enterprise Viewer viewport.

Queries may be created and edited using the Query function, which is available as a tab in the Select Objects dialog box. From here, they may be saved as .rhq files.

When you create a query, you create a set of statements. These statements contain filters and action sets. Each statement has one or more filters that are tested against the objects in the Bill of Materials, or node hierarchy. It also has one or more actions that are taken on the objects that match the filters in the statement. A filter may match all of the objects in the Bill of Materials (BOM), or a subset of those objects. A list of objects is found using the Query filter(s), and then the actions are applied to those objects located.

Multiple statements can be read from each file. The query statements are run in the order in which they appear, and the results from one statement may be used directly or indirectly in the next statement. The actions include, but are not limited to, hide, show, change material, and set layer. These actions apply to the matched objects, and their children in the BOM. Optionally, the actions may be restricted to apply to only the matched objects and not to their children unless they also are also matched with the same filter(s).

Query Evaluation

Each node in the BOM is evaluated using the filters based on metadata (attributes of nodes or their parents) values and node specific values; for example, the polygon_count. The filter part of the statement can include tests on node values, tests on metadata for a node or for the parents of a node, and tests on other states like whether the node is hidden or showing in the viewport.

When a query is run, the evaluation proceeds in the following manner:

  • If there is an Initial Scene Setup, this is performed.

  • Each statement is processed in order.

  • Each filter is tested against every object in the scene, respecting and/or/not logic if any for filters.

  • Actions are performed on all objects that match the filters for the statement