# Linear Quantities Made Quick

As Published in the March/April 2007 AUGI World Magazine

Somewhere in the lifecycle of nearly every project there will come a time where quantities must be calculated. Regardless if they are a part of a review agencies requirements, or in-house needs insuring your project isn’t over budget â€“ calculating quantities is quite simply no fun. Granted base AutoCAD offers some impressive tools to automate calculating the number of blocks inserted in a drawing, but still what about linear features such as lines arcs and polylines? Calculating the total linear feet for each diameter of waterline in a project could easily take hours using commands such as PEDIT and LIST. At the end of it all you kick back in your chair and say to yourself â€“ there has to be a better way? There is in fact a better way, and it is found within Autodesk’s Map 3D software package. Using Map 3D it is possible to calculate linear quantities in a matter of minutes as opposed to hours. Making such a time savings possible are Map 3D’s topologies. By design topologies are technically a GIS tool, but with a little imagination they can be quickly made an engineer’s best friend.

## Understanding Topologies

By definition topologies are a set of geometric connections between objects. While the definition may be a little cryptic, if one takes a moment to think about it, nearly everything illustrated in a set of engineering plans falls into this category. Take for example a waterline design. The numerous pipes (objects) will be assembled together (geometric connections) to ultimately construct a complete water system. Using a “Network Topology”, statistics (including length) for such a waterline system can be calculated in a matter of minutes. Autodesk’s Map 3D allows for three distinct topology types; node, network, and polygon. The different topology types mirror the different ESRI shapefile types of point, polyline, and polygon. Which topology to use will be determined by what type of entities you are working with. In our case we’re interested in calculating the total length of waterline in our design. For linear features such as waterlines, a network topology is best suited for our scenario.

## Structuring your Drawing

Although individual entities can be selected and added to a topology, breaking items such as your 6 in. and 8 in. waterlines onto two separate layers will streamline the creation of your topology. While it may seem elementary, taking a quick moment to insure no extraneous linework is contained on your layer(s) to be calculated will of course insure an accurate quantity. Taking a couple extra minutes to structure your drawing as outlined above from the beginning will make up to the minute quantities possible during your next design charette.

## Creating a Network Topology

Similar to AutoCAD in the way it makes commands available in numerous ways, topologies can be created in one of two ways; using the Map Explorer in the Map Task Pane, or by working through the Map menu itself. Although both methods have their advantages, to keep things as simple and concise as possible this article will work through the Task Pane.

1. Open the Map Task Pane â€“ The Map Task Pane loads by default with Map 3D (although you may have disabled it). Use the “MAPWSPACE” command to turn the Map Task Pane back “On” if you have closed it.
2. Set your Task â€“ The “Map Explorer” task pane will be needed to create a topology. Do note the slight interface change between the Map 3D 2006 and Map 3D 2007 releases. Map 3D 2006 uses tabs on the side of the interface â€“ similar to tool palettes. Instead of tabs on the side of the interface, Map 3D 2007 (Figure 1) has a pull-down at the top of the interface explicitly labeled “Tasks”.
3. Create your Topology â€“ Of the options in the
Map Explorer task pane is “Topologies”. To create topology right-click on the “Topologies” option and select “Create” (Figure 1).

4. Specify your topology type â€“ As discussed earlier, there are three distinct topology types available within Map 3D; Node, Network, and Polygon. From the “Select Topology Type” dialogue box select the “Network” radio button. The title of the dialogue box should update to read “Create Network Topology â€“ Select Topology Type” (Figure 2).
5. Give your Topology a Name â€“ Although you will likely discard your topology after calculating its length; you still must give it a name. Use something logical. If calculating the length of an 8 in. waterline a logical name may be “WATR-08IN” (Figure 2). You may choose to also provide a description although it does not affect the functionality of the topology command. Press the [Next] button.

6. Select what to calculate â€“ Upon pressing the [Next] button you will be presented with the “Select Links” dialogue (Figure 3). Quite simply, the “Select Links” dialogue is merely asking what entities you wish to add to your topology (and ultimately calculate the length of). Within the create topology command there are four distinct ways objects can be selected; all objects, by object, by layer, or by class.

In this case we’re interested in calculating the total length of 8 in. waterline. Thanks to a little upfront work, this particular drawing has a separate layer for each pipe diameter. For that reason I can simply select the layer name that contains my 8 in water pipes (C-WATR-UNDR-08IN). Had this drawing not been structured with each pipe diameter separated onto its own layer, the manual selection method could have been used. Objects may be added to the topology manually by clicking the button to the right of the “Select Manually” radio button. If you hover over the button the tooltip will read “Select Links”.

7. Finish your topology â€“ Even though the create topology has a couple more dialogue boxes, enough information has been provided for Map to generate a linear quantity desired. Thus at this point we can press the [Finish] button.

8. Gathering your Quantity â€“ With your topology now defined, statistics can be calculated on it. Back at the “Map Explorer Task Pane” right-click on the name of your topology and select “Statistics” (Figure 4).

9. And the number isâ€¦ – After selecting “Statistics” a new dialogue will appear. The “Topology Statistics” dialogue will display a number of statistics about your topology. Admittedly most will be interested in but one number â€“ the total (Figure 5).

## Command Line Version

An interesting fact about Map 3D is the way most Map commands have the ability to function in a textual command line based interface. Consistent with most standard AutoCAD commands, prefixing the command with a hyphen “-” will suppress its graphical dialogues, and inherit a command line only functionality. Most humans will of course prefer the graphical dialogues. On the other hand, by using the command line, regularly calculated linear quantities have the potential to be automated with a script. The two Map 3D commands used in this article were: MAPTOPOCREATE and MAPTOPOSTATS. Adding a hyphen to the â€“MAPTOPOCREATE command will allow a topology to be created from the command line. It’s important to note the command prompts for the MAPTOPOCREATE command are not in the same order as the dialogue boxes are. The command line version of the command asks for nodes to be selected first. Nodes were not used in our scenario, and thus can be skipped over in the command line version of the command. Be sure to add linear entities as links when using the command line. Unfortunately there is no command line equivalency of the MAPTOPOSTATS command. Although the command cannot be controlled from the command line, it doesn’t make knowing the command a worthless bit of trivia. Typing MAPTOPOSTATS (without a hyphen) at the command line will result in its graphical dialogue being launched. Tagging this command at the end of an automation script would still guide a user in the right place, allowing them to quickly calculate a linear quantity. It’s no secret; the engineering design process is very iterative. Despite that known fact clients rely on design teams to provide accurate and up-to-date take off’s to insure their project is on budget. Municipalities are also traditionally eager to know these same quantities for purposes of budgeting future maintenance costs. Regardless of who the quantities are being calculated for, up to the minute quantities can now become a reality. Although the topology tools are more focused towards GIS, they can prove invaluable on the engineering side by saving both time and money.

Donnie is author of the book and Autodesk Official Press, AutoCAD and AutoCAD LT: No Experience Required, a columnist for AUGIWorld Magazine, Autodesk University speaker, and former member of the AUGI Board of Directors.

1. #### Cynthia Alexander

I have a piping project and I trying count linear feet of pipe solid; do you know of a easier way? Thanks in advance Cynthia

2. #### Cynthia Alexander

I have a piping project and I trying count linear feet of pipe solid; do you know of a easier way? Thanks in advance Cynthia

3. #### Allison

I used this and it works great. However, for some reason I have to run through the routine twice. The first time it doesn’t create the topology. Then I go back through the same routine and by the time I’ve pushed exactly the same buttons and done exactly the same thing, it works. This keeps happening with all topologies. Is it a glitch in the version of Autocad Civl?

4. #### Allison

I used this and it works great. However, for some reason I have to run through the routine twice. The first time it doesn’t create the topology. Then I go back through the same routine and by the time I’ve pushed exactly the same buttons and done exactly the same thing, it works. This keeps happening with all topologies. Is it a glitch in the version of Autocad Civl?

5. #### Donnie Gladfelter

I have used this method for some pretty complex designs, with well over 200 vertices along my lines/arcs/polylines. Do note that if you are trying to create a topology for points (or Nodes) you will need to use a node topology and not a network topology. Hope that helps you into the right direction.

6. #### Donnie Gladfelter

I have used this method for some pretty complex designs, with well over 200 vertices along my lines/arcs/polylines. Do note that if you are trying to create a topology for points (or Nodes) you will need to use a node topology and not a network topology. Hope that helps you into the right direction.