You are on page 1of 18

ENR500009

Power BI and Plant 3D – Improve Decisions with Data


Visibility
David Wolfe
Applied Software Technology Inc.

Learning Objectives
• Connect Power BI to Plant 3d SQLite or SQL Server Databases
• Navigate the Plant 3D Data Model
• Create Model Dashboard
• View Progress status of the design by comparing PnID lines to modeled and
isometrics

Description
Connecting Power BI to Plant 3d enables your organization to apply business intelligence to
your design models. Raise the visibility of the design process by giving project managers,
engineers and other teams access to your model data without interrupting the design process.
Power BI can help answer questions like:
-What's the project progress in modeling?
-How many lines still need isometrics?
-Did all my equipment get modeled yet?
-Is my line list complete?
These are common questions to ask, but they can require so much work to get an answer that
the design process has to stop. With Power Bi, your reporting and project status information can
be pulled in parallel with your design efforts. By being able to bring the status information to a
weekly stand up meeting, your team can focus on discussing solutions instead of discovering
problems.

Speaker

David Wolfe - Develops sales and technical software approaches for Autodesk
products in the plant and process industry. Identifies product development
opportunities for clients and organizational growth. Grows team skills and
implements best practices into services execution.

Page 1
Overview
Autodesk AutoCAD Plant 3D (Plant 3D) is known for its powerful database and reporting
capabilities. As powerful as the program is, the role of data in business decisions and availability
has massively shifted since AutoCAD Plant 3D was introduced on the market. This class will
help provide context and perspective on how the advances in Power BI maturity can help your
company make better decisions with data.

Business Context
While the bulk of the document is about the technology involved, as you mature in software
implementations, the role that the business context has to play in the success of an
implementation starts to become more clear. Each business must take care to craft a healthy
data culture in order to see the competitive advantage for decision making (Diaz, Rowshankish,
& Saleh, 2018).

The reporting detail of your data will tend to mimic the role in the hierarchy and function within
your business. The data that Plant 3d generates will allow making informed decisions at a mid
or lower level. Should the data be aggregated and attached to project tasks or scheduling data,
you could generate charts and graphics to inform decisions at a higher and broader scope
within your organization. Trends like activity, time lapsed from start to last activity could help
shape larger initiatives within your organization without burdening users with self-reporting or
additional data entry steps.
Resources
Like any topic in technology, Power BI with Plant 3d is an evolving conversation that changes as
people adopt the tool in new ways. For the latest updates on the topic, check out the series
https://www.asti.com/series/power-bi-and-plant3d/.

For ease of navigation, here’s a table of the resources utilized in this class.

Description Link
Power BI Desktop https://powerbi.microsoft.com/en-
us/downloads/
Power BI Pricing https://powerbi.microsoft.com/en-us/pricing/
Connect Power BI to Plant 3d SQLite https://www.biinsight.com/visualise-sqlite-
data-in-power-bi/
http://www.ch-werner.de/sqliteodbc/
SQL Server Management Studio https://docs.microsoft.com/en-
us/sql/ssms/download-sql-server-
management-studio-ssms?view=sql-server-
ver15
SQLite Expert http://www.sqliteexpert.com/download.html

Page 2
Connect Power BI to SQLite or SQL Server Databases
Power BI can open a wide array of data sources. SQL Server is commonly used to hold data for
project that have more than 3-5 designers. Here’s an example of how to use Power BI Desktop
to connect to SQL Server.

Connecting to SQL Server

On the splash screen, click Get Data, or on the main starting page, click Import Data from SQL
Server.

Enter your SQL Server Name information. You can find the SQL Server information for your
existing Plant 3D SQL Server based project under Project Setup > Database Setup

Enter the same server name in the Power BI SQL Server Database dialog. When implementing
in a production environment, you will need to make an informed decision about whether to use
Import or DirectQuery (Baucke, 2021).

Page 3
Most companies setup Windows authentication to connect to the SQL Server so on the
credential page, you should be able to select Use my current credentials.

After you connect to the SQL Server instance, you will have a list of databases to select.

Plant 3D creates five (5) databases per project. You can customize the database name when
creating the project. You should use names that correspond to the project name or number. The
databases will end in _Iso, _Misc, _Ortho, _Piping and _PnId.

When you expand the databases, you will be able to select the queries and tables to use.

Page 4
Check the following items.

_PnId: EngineeringItems_PNP, Equipment_PNP, InLineAssets_PNP, InlineInstruments_PNP,


PipeLineGroup_PNP, PipeLineGroupRelationship_PNP, PipeLines_PNP, PnPDataLinks_PNP,
PnPDrawings_PNP, PnPProject_PNP

_Piping: EngineeringItems_PNP, Equipment_PNP, P3dLineGroup_PNP,


P3dLineGroupPartRelationship_PNP, InlineInstrument_PNP, Valve_PNP, PnPDataLinks_PNP,
PNPDrawings_PNP

_Iso: PnPDrawings_PNP, PnPDrawingCustomProperties_PNP

After all of the items are selected, click Load.

Connecting to SQLite

SQLite is not supported with direct integration into PowerBI, but because it is such a popular
database format, make tools have been created to work with the file format. Check the
Resources section to see additional tools. The guide by Soheil Bahkhshi provides the best
information to connect Power BI Desktop to SQLite (Bakhshi). However, using SQLite will be a
very manual process, so a better practice would be to use SQL Server if possible. You can use
the free version of SQL Server Express. You will need to create custom scripts to automate
backing up the SQL Server if you use the express version. Nightly backups should be
implemented.

Install the latest version of Power BI Desktop (see Resources section).


Install the SQLite ODBC Driver (64 bit).

On the splash screen, click Get Data, or on the main starting page, click Get data from another
source

Go to Other > ODBC and click Connect. In the Data Source name (DSN) select SQLite3
Datasource, and then expand Advanced options.

Page 5
For the first path, use the ProcessPower.dcf file located in the project. This is the PnID
Database. Use the parameter database= and put in the path to one of the dcf files from a Plant
3D SQLite, Vault, or BIM 360 project. You must not include “” in the path. If you do, you may
receive an out of memory exception.

Here’s the error you get if you accidentally include “” in the file path.

Choose Default or Custom for the ODBC Driver authentication page, and click Connect.

In the Navigator, check the following items, and click Load.

EngineeringItems_PNP, Equipment_PNP, PipeLineGroup_PNP,


PipeLineGroupRelationship_PNP, PipeLines_PNP, PnPDataLinks_PNP, PnPDrawings_PNP

Page 6
Connect to the Piping.dcf and Iso.dcf using the same steps. Select the following for each of
those databases.

Piping.dcf: EngineeringItems_PNP, Equipment_PNP, P3dLineGroup_PNP,


P3dLineGroupPartRelationship_PNP, PnPDataLinks_PNP, PnPDrawings_PNP

Iso.dcf: PnPDrawings_PNP, PnPDrawingCustomProperties_PNP

Validating Connection
After you finish connecting with either SQL Server or SQLite, you should be able to see the
Fields list tables from the various data sources. You can preview the data by switching to the
tables view.

Page 7
Changing Databases
If you need to switch to a database a different location, you can edit the database within Power
Query. You can easily modify the included example file to point to your own project using this
technique.

Navigate to File > Options and settings > Data source settings

Use Change Source to edit the path for the dcf.

Now that you can connect to SQL Server or SQLite Plant 3d databases, you need to understand
how the database is structured in order to build effective charts.

Page 8
Navigate the Plant 3D Data Model
To build Power BI charts, you need to be able to assemble your dataset to build the structure
needed for your charts.

Tables vs Queries
You will notice that above when we selected our items to view in Power BI, every item ended in
“PNP”. Plant 3D appends PNP to every query that the api creates. You can recognize tables
within the Plant 3D database structure by the fact that they do not end in “PNP.”

PnPID
You have seen the PnPID as a column in the Data Manager if you are familiar with using Plant
3D. This identifier has a key role to play in the database as it keeps all of the items using in the
database unique.

The best way to understand the role of the PnPID is to trace it through the database structure
starting at PnPBase. PnPBase is the root of our data hierarchy in the database. Similar to how
EngineeringItems is the root within the project setup dialog, the PnPBase table is a system table
that tracks the details of all Plant 3D items. Similar to the Class Properties within Project setup,
tables lower in the hierarchy will inherit properties in the tree above them. You can view this
most easily by examining the SQL contents in the queries we referenced. Every row that is
added on any table will have a matching entry on the PnPBase table to link it with a project item.

Page 9
Relationship Tables
The Plant 3D database has a very abstract method of relating items that is flexible, powerful,
and extensible which can at times make it feel inscrutable. The database using relationship
tables to link items from different classes. Using the same PnPID as above, you can find the line
group PnPID that the part is related to by referencing the P3dLineGroupPartRelationship table.

Noting that the LineGroup id is 5752, you can look up the line group information in the
P3dLineGroup table.

Connecting Drawings to Objects


Every developer for AutoCAD has to related AutoCAD objects like lines, arcs, circles, pipes, etc
to a drawing file using two pieces of information, the object handle, and the file name. Plant 3D
does this within the PnPDataLinks table. The same PnPID 8955 can be related back to a
drawing. The tricky part though is that on the PnPDataLinks table, the part id is stored in the
RowId column. As mentioned before, every row created in the Plant 3D datastructure has its
own PnPID from the PnPBase table, so the PnPID column in the PnPDataLinks table is tracked
back to PnPBase as well.

Page 10
You need to note the DwgId, DwgHandleLow and DwgHandleHigh columns in the
PnPDataLinks table. If you are a developer, handle columns can be converted to an AutoCAD
object handle using hexadecimal format, so 35678 would convert to 0x8B5E. The 0x8B5E can
be using by the AutoCAD api to locate items in a drawing file.

To relate the part (8955) back to its source drawing file, you need the DwgId which is 4284.
Then you would open the PnPDrawings table, and locate the file with that PnPID.

Create Model Dashboard


You can apply understanding of the Plant data model to build a dashboard for your models. The
rough outline of the process for creating charts on dashboards is:

1. Identify questions to answer


2. Select a metric to test for impact to question
3. Identify or configure the data to provide the metric
4. Develop the model (definition of data modeling, not a 3d model)
5. Create charts/graphcs and customize dashboard

The Plant 3D data won’t yield answers to the question about whether the project is on budget or
on schedule, as data points are not part of the schema. However, you can focus in on several
common issues that cause schedule delay or changes to project budget.

Metric Scoping
In a normal design process, you build the structural model first, then equipment, and then start
the piping. In that process, the vendor information for equipment ends up stopping progress on
piping design as designers wait for vendor information. The outline for the equipment model
dashboard looks like the following:

Page 11
1. What equipment has not been modeled yet?
2. Metric – tags missing from models that are on a P&ID
3. The tag information, drawing and model information is captured as users create the
equipment so no additional data capture steps are necessary
4. Additional columns – Each equipment tag should list the P&ID drawing, model drawing,
and a column for IsModeled
5. Chart – use a pie chart and show percentage of equipment modeled.

Data Model Definition


The data model will consist of several steps which will need to be configured to get the needed
output.

Project Equipment Table


To organize the needed data, you need to build a table that combines the equipment from the
P&IDs, and the equipment in the model. You should also add some helper columns to identify
whether the item is modeled, and whether it is on a P&ID. Because this is a table that doesn’t
exist in the database anywhere, but it is made up of rows extrapolated from the database, this is
called a logical table.

First you need to define the relationships. Review the provided samples files to understand how
they were configured. In the summaries below, a table and column will be listed in the format
tablename.columnname.

EngineeringItems_PNP_PnID Summary:
Relate PnPID column to the Equipment_PNP_PnID.PnPID column.
Relate PnPID column to PnPDataLinks_PNP_PnID.RowId column
Relate PnPDataLinks_PNP_PnID.Dwgid to PnPDrawings_PNP_PnID.PnPID

EngineeringItems_PnP_Piping Summary
Relate PnPID column to the Equipment_PNP_Piping.PnPID column.
Relate PnPID column to PnPDataLinks_PNP_Piping.RowId column
Relate PnPDataLinks_PNP_Piping.Dwgid to PnPDrawings_PNP_Piping.PnPID

Next you need to create a new table which will hold our combined list of items. Review the table
Project_Equipment in the sample files. The first column will have the DAX language that creates
the table. After creating the Tag column in the Project_Equipment table, relate it to the Tag
columns on both the Equipment_PNP_PnID and Equipment_PNP_Piping tables. Select each
column and view the DAX language to see how the column was created.

Page 12
Adding Items to Dashboard
The final step you need to complete is adding the data to a dashboard. Power BI makes the
creating of the graphic the easiest part.Click the Pie Chart button in the Visualizations panel to
place a pie chart on the screen.

With the visualization selected, add the modeled status to the legend, and the Tag to the
Values.

Page 13
After adding charts for modeled and on pnid, your dashboard looks something like this.

Page 14
One nice feature about Power BI is the ability to theme the dashboards. You can use a tool like
paletton (https://paletton.com/) to generate a color palette and test for color blindness. Then you
can generate a theme that is importable to Power BI using a tool like the report theme generator
(https://powerbi.tips/tools/report-theme-generator-v3/ ). The report generator will create a json
file that you can import.

After importing the theme, your report could look like the below:

Page 15
You will want to put some finishing touches on the dashboard. The styles panel will let you
adjust the title and other cosmetic features.

Page 16
View Progress status of the design by comparing PnID lines to modeled
and isometrics
You can also provide clarity into project status by reporting on the number of lines on the P&ID,
in the model, and on isometrics. The technique to do so is much more complex, and involves a
good understanding of data models and Power BI techniques. Review the sample file and look
at the PnPDrawings_PNP_Iso table. Columns linking the file to the line number and IsoStyle
have been added to the table.

The bulk of the rest of the work has been done on the Project_Lines logical table where
columns were added for commonly referenced information.

Adding a note and a chart to the dashboard yields the following:

Page 17
References
Import vs Direct Query: Here's What You Need to Know
Why Data Culture Matters

Page 18

You might also like