Advanced query example: material list

In this example, we create a material list using a dynamic query that selects objects which fulfill the following requirements:

  • Object type is Piping or Standard Component.

  • Object is inside a given bounding box.

  • Object is assigned to a specific System.

  • Object has been modified during the last two weeks.

Do the following:

  1. On the Documents tab, select Listing > Materials. The Listing dialog opens.

  2. Click Generate.

  3. Specify the report name, select the ICGD to use, and click OK.

  4. Create a new query:

    1. Right-click the work view and select Queries > Project query. The Select and Manage Stored Queries for Define-Set dialog opens.

    2. Right-click the query list and select New > Model Query. The Edit Query dialog opens.

  5. In the Object types section, select Piping and Standard comp. as the object types to be included in the material list.

  6. In the Bounding box section, select Inside and define the area that contains the objects to be included in the material list.

  7. In the Rules section, click New. The Edit Selection Test dialog opens.

  8. Set Test Passed If to "ALL conditions are true".

  9. Create a rule for the System of the object:

    1. Set Source to "Object data (PM)".

    2. Set Class to "General".

    3. Set Attribute to "Object's system name".

    4. Set Condition to "One of".

    5. Set Get Sample By to "Select".

    6. Click Get Sample By, select the required Systems, and click OK.

    7. Click New.

    The first rule is now ready.

  10. Create a rule for the modification time of the object:

    1. Set Source to "Object data (PM)".

    2. Set Class to "General".

    3. Set Data to "Modification time".

    4. Set Condition to "Within the Last" and type "2" in the Weeks field.

    5. Click New.

    The second rule is now ready.

  11. Click OK. The Edit Selection Test dialog is closed.

  12. Click Save As, enter a descriptive name for the material list query, and click OK.

  13. Click OK to close the Edit Query dialog.

  14. In the Select and Manage Stored Queries dialog, select the material list query and click OK.

  15. In the work view, press Enter to accept the objects that the query has selected.

    The material list is generated.

  16. Click Close to close the Listing dialog.

Tip: As the query is now stored in the project database, you can use it for any query-based operations where you want to select the same set of objects that you selected for the material list.