You are on page 1of 3

Data queries enable you to query objects from source drawings based on certain types of attributes

that are connected to those objects. Examples of this would be object data, attributes, or object

classes.

Start with a blank drawing with no source drawings attached. Then in the Map Explorer, right-click

Drawings and click Attach. In the Select Drawings dialog, select your drive alias, navigate to the

dataset folder, and then select the Drainage, Parcel, and Sewer drawings, and click Add, and then

OK.

Next, to give you an orientation of where your source drawings are, right-click the Parcel drawing and

click Quick View, and then right-click again and click Zoom Extents.

Next, double-click the Current Query. In the Define Query dialog box, under Query Type, click Data.

The Data Condition dialog box opens, where you can see the different data conditions that you can

use to define this query. You can query based on Object Class, Object Properties, Database Link,

which in this case is a single value that resides in a key column of a database, Object Data, which is

the most common of all data conditions, and finally Attributes, which are the standard AutoCAD block

attributes.

For this query, select Object Data. You can see that as soon as you do that, the drop-down under

Tables gives you a list of the object data tables that are in the attached source drawings. When you

expand this Tables list, you can see that there are drainage inlets, drainage pipes, parcels, and so on.

Select the SEWER_PIPES table. Once you select this table, you can see all of the fields that are in

that table.

For this exercise, create a query that retrieves all sewer pipes that have a diameter greater than 8

inches. Click the PIPESIZE field, and under Expression, for Operator, choose greater than (>). For

Value, enter 8. And with that set, click OK.

Back in the Define Query dialog, under Current Query, you see the statement that you just created.

Set this Query Mode to Draw, and then click Execute Query.

Once that query is complete, when you zoom in to take a closer look at this, you can see some of the

pipes that you queried, and in this case, all these pipes have a diameter greater than 8 inches. Since
you executed a drawing query, each of these pipes is now copied into the current drawing. Select one

of these, right-click, and select Properties, and you can examine the Object Data that is attached to

this sewer pipe. In the Properties Palette, you can scroll down and under the Object Data table, you

can see the pipe size. If you listed any of these objects, you would see that they all have a diameter

greater than 8.

Zoom extents, and create another query that is based on street address from an Object Data table

that is attached to these parcels. In the Map Explorer, double-click the Current Query to open the

Define Query dialog. Clear the current query, click Data, and select Object Data again. This time, pick

the PARCELS Object Data table. Within this


table is a field for the street name, so select that. For the Value, type in "Silverwood St", and click OK.

Confirm that this is a Draw query, and click Execute Query.

At the command line, you can see 26 objects, and these are the parcels that are located on

Silverwood Street. Zoom in to these for a better look.

You can start to see how powerful data queries can be, and how you can sort through very large

amounts of data to find the specific objects that you want to work with, such as parcels with a specific

address, or pipes that are a certain size.

You might also like