Sie sind auf Seite 1von 3

Report queries offer a very powerful tool that enables you to create queries for the objects in your

source drawings, and rather than bring the objects into the current drawing, you can send the results

to a report.

Start with a blank drawing, and then attach some source drawings. In the Map Explorer, right-click

Drawings, and click Attach. Select your drive alias, navigate to the dataset folder, and select the

Drainage, Parcel, and Sewer drawings. Click Add, and then OK. To orient your view, perform a Quick

View on the Parcels drawing, and zoom to extents.

In this scenario, there is a specific neighborhood in the city where you want to create a quantity takeoff

of all of the sewer lines. You want to include the information for their length, ID numbers, material,

and diameter. Zoom in on the neighborhood. The first thing to do is create a query that limits the

report to this neighborhood. In the Map Explorer, double-click Current Query. In the Define Query

dialog, click Location, use a Polygon, and click Define, then draw a polygon surrounding the

neighborhood, and press ENTER. Since you have several drawings attached, add a Property

condition to this query, to limit the results to a specific layer. Click Property, select Layer, and click

Values. In the Select dialog, click the SEWER_PIPES layer, and click OK. Back in the Property

Condition dialog, click OK. Back in the Define Query dialog, you'll see that you now have the query

that limits the area, and retrieves only sewer pipes.

Next, for query mode, click Report, and select Options. The Output Report Options dialog is where

you define the report itself. Start by adding an expression to the report. Click Expression, and in the

Report Template Expression dialog, then expand Object Data because this is where the data resides

that you want to include in the report. Here, use the SEWER_PIPES table, and select RUN_ID, and

click OK. Under Expression, you can see this expression that retrieves the run ID from the sewer

pipes table. Click Add, and you can see that you have begun to build the report template, one

expression at a time.

Repeat this process to add the fields that you want to include in the report. Click Expression, then

Object Data, expand the SEWER_PIPES table, and this time select Length, and click OK. Now add

this expression to the report template. Repeat this process to add more fields to the report. Click
Expression, expand the SEWER_PIPES table, and this time select PIPESIZE, and click OK, and click

Add. Add the last expression to the report. Click Expression, Object Data, expand the

SEWER_PIPES table, and this time select PIPETYPE, and click OK, and then click Add.

Now that the report template is defined, the next step is to specify the output file name. This report

will be in the format of a comma-delimited file, which you can use to import into almost any word

processing document, database or spreadsheet.

To do this, you first need to create an output file name. Click Browse, and browse to the location

where you would like to save it, in this case in the CADLearning, Chapter 8 Queries folder, and give it

a name. Type in "Pipes", and click Save. Then click OK.


Back in the Define Query dialog, click Execute Query. At the command line, you can see the number

of objects that have been queried. And in this case, rather than sending those objects to the screen,

the results have been sent to the Pipes text file you just created.

Next, using Windows Explorer, navigate to the Chapter 8 Queries folder, open the file with Notepad,

and examine the results. Here in Notepad, you can see that each line of the text file has a value for

pipe ID, length, diameter, and the material. All of these values are separated by a comma, and you

can import this file into a word processing document, a database or into a spreadsheet.

Das könnte Ihnen auch gefallen