Create Exchange Using AEC Data Model Filters
This task will guide you through creating an exchange using AEC Data Model filters to extract detailed, granular data from the exchange
You can filter the data based on Category, Family, and Type. For each filter, you can select an option of your choice. For example, if you want to extract only windows from a model, select the “Windows” option under Category. You can then refine your selection further by applying additional filters under Family and Type as needed.
In this tutorial, we will create an exchange using the AEC Data Model filter, specifically focusing on the Windows category.
You will use the following mutation in this task:
Type | Operation | Description |
---|---|---|
Mutation | createExchange | Creates a data exchange. |
Step 1 - Create Exchange based on filter category “Windows”
The following steps demonstrate how you can run the createExchange mutation to create an exchange based on the AEC Data Model filter category “Windows”.
- Enter the following query in the Query Pane of the Data Exchange Explorer.
Query
mutation CreateExchange( $filter: String $sourceFileId: String! $targetExchangeName: String! $targetFolderId: String! ) { createExchange( input: { filter: $filter source: { fileId: $sourceFileId } target: { name: $targetExchangeName, folderId: $targetFolderId } } ) { exchange { id name elements { results { id name } } } } } }
Show More - In the Query Variables pane, enter the values for the following fields:
- filter: The RSQL AEC DM filter string that specifies the criteria for data extraction. In this case, the filter is based on the Windows category.
- sourceFileId: The item ID of the source file from which the exchange is being created.
- targetExchangeName: The name of the exchange that will be created.
- targetFolderId: The ID of the target folder where the exchange will be stored.
Query Variables
{ "filter": "(category=='Windows')", "sourceFileId": "aXRlbX5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby5ON21kU05TSFR3Nk81dWNualhsSjJRfnVybjphZHNrLndpcHByb2Q6ZG0ubGluZWFnZTpCVGJ3enVuSlFRU0wwTVBsbFhNVDZB", "targetExchangeName": "AEC Filter based Exchange - Category Windows", "targetFolderId": "Zm9sZH5iLjc2OGNhZTE0LTc2YjMtNDUzMS05MDMwLTI1MjEyZGFiNGU0OH5iLjIyYTVkYzQ3LWNhMTktNDIzMS05ZjNlLTE1N2ViZDQ4NDJmZn51cm46YWRzay53aXBwcm9kOmZzLmZvbGRlcjpjby5ON21kU05TSFR3Nk81dWNualhsSjJR" }
- Click Play. The exchange will be created based on the filter category==’Windows’ and the response will look similar to the following code block.
Response
{ "data": { "createExchange": { "exchange": { "id": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjU1NGEzMGMzLTkxYWMtMzIwNC04NzVmLWM0MDc3ZjJkZDI1YQ", "name": "AEC Filter based Exchange - Category Windows", "elements": { "results": [ ] } } } } }
Show More
The exchange has been created successfully; however, the result contains empty elements. This could be due to the exchange being in one of the following states: IN_PROGRESS, FAILED, or COMPLETED with no elements. Refer to ExchangeStatus page to learn more about the status of the exchange.
To check the status of the exchange, you can run the getExchangeCreationStatus query. For detailed instructions, refer to the procedure outlined in the next step.
Step 2 - Get Exchange Status
The following steps demonstrate how you can run the getExchangeCreationStatus query to check the status of the exchange that was created in the previous step.
- Enter the following query in the Query Pane of the Data Exchange Explorer.
Query
query GetExchangeStatus($exchangeId: ID!) { getExchangeCreationStatus(exchangeId: $exchangeId) { status versionNumber exchange { id name elements { results { id name } } } } }
Show More - In the Query Variables pane, enter the value for the exchangeId field.
Query Variables
{ "exchangeId": "ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjU1NGEzMGMzLTkxYWMtMzIwNC04NzVmLWM0MDc3ZjJkZDI1YQ" }
- Click Play. The response will look similar to the following code block.
Response
{ "data":{ "getExchangeCreationStatus":{ "status":"COMPLETED", "versionNumber":1, "exchange":{ "id":"ZXhjfnlwdWFzY1NicWlIT0R1R0s4OUkwTHdfTDJDfjU1NGEzMGMzLTkxYWMtMzIwNC04NzVmLWM0MDc3ZjJkZDI1YQ", "name":"AEC Filter based Exchange - Category Windows", "elements":{ "results":[ { "id":"YWVjZX53TGhzYkpOSmVndGM5QlVsaFB6a2xwX0wyQ35CVGJ3enVuSlFRU0wwTVBsbFhNVDZBXzU3YmEy", "name":"36\" x 48\"" } ] } } } } }
Show More
The exchange status is COMPLETED. To retrieve exchange-related information, follow the steps in Task 4 – Get Exchange, or refer to tasks under Advanced Queries.
If the status is IN_PROGRESS, wait for the exchange to complete and then follow the same steps to retrieve the information.