> For the complete documentation index, see [llms.txt](https://docs.orkestra.online/okpy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orkestra.online/okpy/okpy-integrations/okpy-for-revit/build-with-the-agent.md).

# Build with the agent

Build an interactive Door Summary dashboard for exploring the doors in your Revit model.

## Start with a clear request

Open **OkPy**, select **New Tool**, and choose **C#**. Select **`<None>`** in the template list to start with a blank tool. Show the **Agent** panel.

Describe what you want to do, which controls you need, and how the interface should respond. The language is already selected when you create the tool, so this request focuses on the dashboard:

> Build a Door Summary dashboard for exploring the doors in this model. Let me choose a level, search by family or type, and filter by fire rating. Show live totals for doors and door types above a sortable table with family, type, count, width and height in millimetres, and fire rating. Update the table and totals as I change filters, include a clear-filters button, and let me select a row to see its details. Keep the interface open while I work in Revit, with a Refresh button to reread the model. Leave missing fire ratings blank.

![The dashboard request in the Agent panel before sending.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2FjWN80XP8R9mlYniGJrTr%2Fagent-build-01-prompt.png?alt=media)

## Let the agent build

Send the request and leave the editor unchanged while the agent works. If the agent offers a floating panel, choose it for this example.

![The agent building the interactive Door Summary dashboard.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2FuAn5t8YPOvaFbwR6Eut5%2Fagent-build-02-working.png?alt=media)

![The completed dashboard build and green Test button.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2FGf8PPwnKXNWVHVktSfbU%2Fagent-build-03-completed.png?alt=media)

## Test the dashboard

Wait for **Completed** and the green **Test** button. Select **Test**, then **Enter Test Mode** when prompted. For this tool, the floating dashboard opens directly. Its controls live inside the dashboard, so the editor's Inputs panel is empty.

![The floating Door Summary dashboard in Test mode.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2F8x6xgnkadP3i1cK5BzVC%2Fagent-build-04-test-mode.png?alt=media)

1. Choose a level from **All levels**. In the sample model, **L1 - Block 35** shows 8 doors across 5 door types.
2. Select a row to see its dimensions, fire rating, levels, and doors in the details panel.
3. Enter a family or type in **Search family or type...**. The table and totals update as you type.
4. Choose a fire rating from **All ratings**. Select a column heading to sort the table.
5. Select **Clear filters** to return to the full model. Select **Refresh** to reread the model.

![L1 door totals, the populated table, and details for the selected door type.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2FVPEOHccTy0Fef87Zw4Ck%2Fagent-build-05-results.png?alt=media)

Close the dashboard to finish Test mode and return to the editor. The Test mode banner states that document changes are undone when the window closes.

{% hint style="info" %}
The agent never saves. Use **File > Save As** to keep your tool, or publish it to your workspace.
{% endhint %}

## Save your tool

Select **File > Save As** and save the tool as **Door Summary.okpy**. The filename becomes the tool name. If you rename the tool in the header and select **File > Save**, the local filename changes with it.

## Publish to your workspace

Select the header's **Save as** control with the cloud icon to open **Publish to Orkestra**. Fill in the tool details:

| Field           | Value for this example                                                               |
| --------------- | ------------------------------------------------------------------------------------ |
| **Tool name**   | Door Summary                                                                         |
| **Description** | Explore door types by level with search, fire-rating filters, totals and dimensions. |
| **Keywords**    | doors, schedule, levels. Enter each keyword separately.                              |
| **Icon**        | Leave empty for this example.                                                        |
| **Body**        | Leave empty for this example.                                                        |

![The completed publication fields for Door Summary.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2Fjm7Wn4Q5NDlBIr1YFOsE%2Fpublish-01-dialog.png?alt=media)

1. Select **Publish**.
2. In **Add Tool to Online Workspace**, expand **Docs Hub** and select **OkPy Docs**.
3. Select **Add**.
4. In **Transfer Assistant**, verify the destination and select **Upload**.
5. Wait for the successful-upload confirmation, then select **OK**.

![The confirmation that the upload was successful.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2FeBV044VyjjCU4OdEGSuz%2Fpublish-02-published.png?alt=media)

Open **Docs Hub > OkPy Docs** in Orkestra and select **Door Summary.okpy** to check its location, description, and keywords.

![Door Summary published in OkPy Docs, with its description and keywords.](https://33703650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD6LqeGx95FZ5EJU6oorG%2Fuploads%2FC3OLcTJxq1f7LLNB7uu8%2Fpublish-03-in-orkestra.png?alt=media)
