Sie sind auf Seite 1von 5

08/12/2017 Creating a Bill of Material Row Number in Plant 3D ReportsProcess Design, from the Outside | Process Design, from

ss Design, from the Outside

Menu

Search

CREATING A BILL OF MATERIAL ROW NUMBER IN PLANT 3D REPORTS


Posted on JULY 2, 2012 8:00 AM by DAVE WOLFE

This entry is part 1 of 2 in the series Report Creator Scripts


One question that we were able to work through in the past week was due to a breakthrough
regarding using scripts in the Report Creator. The question of getting a row number in the Bill of Report Creator Scripts
Materials has come up on the forums before, but we hadnt found a solution until last week. Introduction to Scripts with the Plant 3D Report Creator
Creating a Bill of Material Row Number in Plant 3D Reports

3D BOM with Row Numbers (119 downloads)


The solution involves a couple concepts. First, well have to create a calculated eld. Then we will have to create a script that makes the appropriate value
for that eld.

Calculated Fields
A calculated eld is a eld that does not get its information directly from the source of the report. Instead a calculated eld can use expressions or scripts to
create a value out of existing reports elds, or create a completely new value.

In the Report Creator, start a new report:

Base the report on the existing Plant 3D BOM.

http://www.pdoteam.com/2012/07/creating-a-bill-of-material-row-number-in-plant-3d-reports/ 1/5
08/12/2017 Creating a Bill of Material Row Number in Plant 3D ReportsProcess Design, from the Outside | Process Design, from the Outside

Give the report a unique name and click Edit report layout.

Switch to the Field list, right+click and select Add Calculated Field.

Right-click on the newly added eld and select Edit Calculated elds.

Change the Name (Mark), expand the Scripts row, click the drop-down for Get A Value, select New and then click Ok.

http://www.pdoteam.com/2012/07/creating-a-bill-of-material-row-number-in-plant-3d-reports/ 2/5
08/12/2017 Creating a Bill of Material Row Number in Plant 3D ReportsProcess Design, from the Outside | Process Design, from the Outside

You should be taken to the Scripts Window which created a function for us at the bottom. The function is that part that starts with private void and ends
with the last brace }.

Now, this script is in C#. Do NOT PANIC. We are going to add about 3 short lines that make the magic happen.

First a little background. I found instructions on how this function works on the GetValueEventArgs topic on the DevExpress site.

The important piece is where it shows us how to set the calculated eld value (e.Value):

Heres the script to enter in the function (and a little piece above it.

The rows that start with // are just comments to help explain what is happening. Outside of the function, we are storing a number that represents the
current row that is about to be in the report (int rowcount = 1). When the report is generated, the calculated eld were going to place will ask for a value.
When it does, we are going to give it the value of the row we are on (e.Value = rowcount). After we set the value, we have to add 1 so that we can use it for
the next row.

All the code lines end in a ; which is C#s way of letting the program know there is nothing else happening on the line.

http://www.pdoteam.com/2012/07/creating-a-bill-of-material-row-number-in-plant-3d-reports/ 3/5
08/12/2017 Creating a Bill of Material Row Number in Plant 3D ReportsProcess Design, from the Outside | Process Design, from the Outside
That wasnt so bad, was it?

Adding the Calculated eld to the Report


Now that we set up the calculated eld so it has the correct value, we need to put it in our report. In the far left cell, right+click, select Insert > Column to
Left.

Once the blank cell is in place, drag and drop our calculated eld onto it.

Heres what it looks like after I cleaned up the cell styles and fonts some.

In the report for downloaded below I also added the PartSizeLongDescription eld to the grouping. Without this eld in the grouping, the report doesnt
gather components correctly, and weve seen clients with anges grouped together wrong.

Without further ado, the nal report output:

And yes, I cant resist putting our logo on stu BTW, thats a hyperlink so you can put that to your companies logo and pull it from the web instead of
embedding it.

http://www.pdoteam.com/2012/07/creating-a-bill-of-material-row-number-in-plant-3d-reports/ 4/5
08/12/2017 Creating a Bill of Material Row Number in Plant 3D ReportsProcess Design, from the Outside | Process Design, from the Outside
Series Navigation

Related Posts:
Uppercas from the BOM s for instead of
Letters AutoCAD Report Plant 3d sets in
in P&ID Creator. Isometric AutoCAD

AUTOCAD PLANT 3D, REPORTS


Tags: AKN_INCLUDE, REPORT, REPORT CREATOR, REPORTS, SCRIPTS

Previous post Next post

LOGIN

Username or E-mail Tiago taf

Password

Remember Me

Log In

Register
Lost Password

SERIES

AutoCAD Plant 3D on SQL Express (6)


Autodesk University (1)
Converting CADWorx Specs (2)
Creating a Nozzle Report (2)
Custom Piping Components Plant 3D (4)
Custom PnID Lines (2)
Getting Started (1)
Report Creator Scripts (2)
Sharing Projects with AutoCAD Plant 3D (3)
Standard Data in AutoCAD P&ID and Plant 3D (2)

Introduction to Scripts with the Plant 3D Report Creator


Creating a Bill of Material Row Number in Plant 3D Reports

RECENT POSTS

Plant 3d 2018.1 Update Project Recycle Bin


A360 Sharing Plant Content
Using Fasttrack Plant for Standardizing Data
Standardizing Data with AutoCAD P&ID
How to Import/Export Line Group Data into my P&ID or Plant 3D?

POST CATEGORIES AUTODESK

Select Category + AutoCAD Plant 3D 2014 Object Enablers

http://www.pdoteam.com/2012/07/creating-a-bill-of-material-row-number-in-plant-3d-reports/ 5/5

Das könnte Ihnen auch gefallen