Skip to main content

Tutorial - AutoCAD Plant 3D

info

Level: Intermediate
Time: 30–45 min

Prerequisites:

  • A VIKTOR account with access to the App Builder, or the VIKTOR CLI for local development.
  • Access to an ACC project with published Plant 3D data and a viewable DWG.
  • An Autodesk Platform Services OAuth 2.0 integration available in your VIKTOR environment.
Beta

The Plant 3D integration is in Beta. Validate the generated tables, quantities and viewer highlights against your source model before using the results in a project.

Introduction​

In this tutorial, you will build apps that use published Plant 3D data from ACC / Forma to review equipment, color valves in a drawing, prepare a quantity takeoff and explore asset relationships. You will use four prompts in the App Builder, each creating a separate app with guided inputs, tables, charts and a drawing viewer.

If you prefer to write Python, open the Local development tab to build a 3D equipment overview app step by step with the VIKTOR CLI. The complete code is included.

1. Set up the integration​

First, you will set up the connection your apps will use to access Plant data in ACC / Forma. Follow the APS OAuth integration setup, then connect the same APS application to ACC.

Next, check that your Plant project has been published to the AEC Data Model. Your apps will query these published data sets. Uploading a standalone DWG does not create a Plant data set. If you need to publish your project, follow Autodesk's Query AutoCAD Plant 3D Project Data instructions.

Existing projects

Existing projects may not be processed automatically by the AEC Data Model. Publish the Plant project again, or publish an updated version, to trigger processing. Once processing is complete, check for the published data sets in the next section.

2. Understand the two Plant data sets​

Plant 3D publishes two main data sets to the AEC Data Model. Each data set is represented by an element group with its own element group ID. The app uses that ID to query its records.

Data setWhat it contains
P&ID Data SetProcess and instrumentation records, such as equipment, lines, valves, instruments and their relationships.
3D Piping Data Set3D model records, such as pipes, fittings, valves and equipment, with their published properties.

The published data sets appear as separate entries in the ACC / Forma Files tool. A P&ID Data Set looks like this:

P&ID Data Set entry alongside a folder in ACC / Forma

A 3D Piping Data Set appears alongside the published 3D drawings and folders:

3D Piping Data Set entry alongside DWG files and folders in ACC / Forma

Keep the default data-set names

The App Builder assumes the data sets use their default names: P&ID Data Set and 3D Piping Data Set. Do not rename these entries.

3. Work with selections and scope​

The App Builder generates the inputs and code to read records through the AEC Data Model API and display the DWG with the APS Viewer SDK.

In the apps you will build:

  1. Select a DWG from the Plant project's published folders using AutodeskFileField.
  2. The App Builder uses the file's project and folder context to find the Plant publication root and discover its P&ID and 3D Piping data sets.
  3. Choose which data set to query from a dropdown.
  4. Open the viewer to display the same selected DWG.

In the generated app, the DWG and data-set selections have different purposes:

You selectThe app uses it to
A DWG file in ACC / FormaFind the Plant publication from its project and folder context, and display that drawing in the APS viewer.
A published Plant data setRead the equipment, pipes, valves or relationships needed for the report. These records can cover several drawings.

3.1. Set the report scope​

The App Builder will use the scope specified in your prompt to determine which records the app retrieves:

  • Drawing scope: records linked to one DWG (prompt 2).
  • Data-set scope: matching records in one complete selected data set (prompts 1, 3 and 4).
  • Project scope: records across several selected data sets in a project.

We recommend starting with drawing or data-set scope so you can verify the results more easily before expanding to several data sets (project scope).

4. Choose your approach​

To build your first app, click the arrow on a prompt to open it in the App Builder. Before submitting the prompt, replace [YOUR-APS-INTEGRATION-NAME-HERE] with the exact name of your configured integration. Connect that integration in the generated app, then follow its input and button instructions.

Prompt 1: Review equipment across one P&ID data set​

The first app creates an equipment inventory for one published P&ID data set. The App Builder uses the prompt to generate the app's inputs, API queries and result views. The app queries the AEC Data Model API for Equipment and its child classes in the selected data set. You do not need to write the query yourself. Use the table to review asset IDs and Tags, and the bar chart to compare counts by concrete class: the specific equipment type, such as a pump or vessel.

Plant 3D P&ID equipment overview

When the app is ready, select a published 2D P&ID DWG and open the viewer first. The viewer can display the drawing before you load a data set. Its colors come from the DWG; prompt 2 adds colors based on queried properties in a 3D drawing.

Equipment overview app with ACC inputs and the selected P&ID drawing in the APS viewer

Click Find data sets, choose a P&ID Data Set, then load the equipment. Open the table to inspect Tags and classes across the selected data set.

Open the chart to compare the equipment counts by concrete class. It uses the same records as the table.

Equipment overview app with ACC inputs beside the equipment count chart

The report covers the selected data set even when the viewer shows only one of its drawings. To request a drawing-only equipment report, replace the scope instruction with: “Retrieve only equipment linked to the selected DWG.”

Prompt 2: Color valves in one drawing​

Build a valve review app for one 3D Plant drawing. Review valve properties in a table, compare counts by body type in a pie chart, and locate the valves by color in the APS viewer.

The table, pie chart and viewer use the same valves linked to the selected DWG. Each body type has one color, shared by the chart and viewer legend.

Plant 3D valve overview

When the app is ready, select the DWG and data set, then retrieve the valves. If the generated app has separate viewer setup buttons, load the available 3D views, select the display and property views, then load the viewer map. This connects the report records to the objects that can be colored.

Plant 3D drawing with valves colored by body type in the APS Viewer SDK

Open the pie chart to compare valve body types in the selected drawing.

Valve body type pie chart with colors shared by the drawing viewer

If you find “Not specified” in the results, the property is missing. If you find “Unmapped”, the report record could not be matched to a viewer object. Keep these records visible in the table even when they cannot receive a viewer color.

Prompt 3: Prepare a data-set quantity takeoff​

The next example creates a quantity takeoff app for a 3D Piping Data Set. Use it to total pipe lengths by their assigned piping specification (Spec) and nominal pipe size (nominal diameter), and count fittings and valves by concrete class. Review the quantities in VIKTOR tables and Plotly charts.

The report covers the complete selected data set, while the viewer displays one DWG.

Plant 3D quantity takeoff

When the app is ready, select a data set and generate the report. Inspect the contributing records and their published units before using the totals. A missing length does not remove a pipe from the record count, and an invalid value must not hide valid subtotals.

Plant 3D quantity takeoff app with independent DWG viewer and data-set report controls

Open the pipe-length chart to compare specifications and sizes. Component counts are a separate quantity; they are not added to pipe lengths.

VIKTOR QTO app showing its data-set inputs beside the pipe-length chart

The component chart covers the selected data set. Its valve count can therefore differ from the drawing-only count in prompt 2.

VIKTOR QTO app showing its data-set inputs beside the fitting and valve count chart

Prompt 4: Explore asset relationships across a data set​

The final example creates an asset relationship explorer for a Plant 3D data set. Find an asset by its Tag, review related objects and their roles in a VIKTOR table, and see the connections in a Plotly diagram. Use the APS viewer to inspect the selected DWG.

The table and diagram use relationships from the selected data set. Choose how far to follow them with the depth input: one hop follows one relationship link, while four hops can reach objects through up to four links.

Plant 3D asset relationship explorer

When the app is ready, select the DWG and data set, enter an asset Tag, then find and select the matching asset. Open the DWG viewer to inspect the drawing.

Plant 3D relationship app with inputs beside the independent APS drawing viewer

Choose how many relationship links to follow and how many objects to show, then explore the results. The table lists the related objects and their roles. Use the graph to see how they connect, and hover over an object to view its properties.

Plant 3D relationship app with asset selection, depth controls and a Plotly graph

A higher depth does not guarantee more results: expansion stops when there are no new peers or the node limit is reached. The graph shows published relationships, not pipe routing or flow direction.

Next steps​

Use these apps as a starting point for your own Plant 3D tasks. Ask the App Builder to review different assets or properties, change how results are grouped, or color objects by another property. Make one change at a time and check the results. Specify which drawings or data sets the report should cover.

Continue with the Autodesk Forma / ACC tutorial or explore the other VIKTOR tutorials.