In my last post titled "Importing & Elevating GIS Contours - Part 1" I discussed a way for us to import GIS Data into an AutoCAD Drawing as AutoCAD entities. While I spoke in context of using it to import GIS contours, truth be known, the process outlined in part 1 can be used for almost all GIS data. Unless you are working with contours, you can probably stop with my last post. Contours (or topography) require a little more work to make them useful.
At this point we have a drawing full of contours, none of which have an elevation. Non elevated contours may be fine for some elementary tasks; more advanced tasks will undoubtedly require your topography to be elevated. If you?re a gluten for punishment, you could always click each contour line, changing its elevation. Thankfully such pains don?t need to be experienced as Map 3D provides us with a semi-automated way of elevating contour data by queuing in on a data field. So just how does one elevate their contour data?
Part one will be to "attach" a drawing to Map. This is similar in concept to attaching an xref. The core difference is that an xref is going to display a picture of your source drawing. The Map attach is going to attach the drawing, but not display it until we tell Map how we want to display it.
Attaching a Drawing
- Start a new (blank) drawing
You're likely thinking "I already have a drawing", but trust me - we need a new drawing.
- Open the Map Task Pane, and go to the "Map Explorer" tab.
If you happened to close it, use the MAPWSPACE command to bring it back.
- Right-Click on "Drawings", and select "Attach"
- Admittedly - the file browsing interface in this part of AutoCAD Map 3D is a little outdated. By a little - I mean a lot. Assuming you are looking for a file on your C drive - things are golden. If you are looking for a file on say a network drive; you must first create a drive alias.
- To set up a Drive Alias in Map 3D, click the button at the top of the dialog.
- Specify the the alias you want to give to your drive. Keep in mind that an alias doesn't have to be an external source, and can actually be a folder on your C drive. If you are working in a drive-letter centric environment, you'll definitely want to name your drive alias the same as its Windows drive letter. In the interest of staying on topic, simply know that an alias could be created for workflow's where user A may be working on a C drive, whereas user B may work on a G drive.
- Pressing Browse will allow you to specify your desired location.
- Press Close, and your drive alias has been created.
- Once a drive alias is created (if needed), you can now browse to the AutoCAD Drawing created in my last post. While anyone familiar with browsing for files should be ok here, know that this dialog does not provide quick links to your "My Documents" directory. In Windows XP the actual path to your "My Documents" directory is "C:\Documents and Settings\username\My Documents"
- Once you have navigated to the drawing currently containing your non-elevated contour lines, select and either double-click, or click the [Add] button to attach it. After that is done you can [Ok] out of the dialog.
Defining and Running a Query
At this point we have teed things up, but despite our hard work, have nothing to show for it. The Query is where the magic happens, and ultimately where we will tell Map 3D to elevate our contour lines.
- From the "Map Explorer" Map Taskpane Tab, right-click on "Current Query", and select "Define".
- The resulting "Define Query" dialog can be a bit intimidating at first blush, but can be tamed rather easily if you follow the concept of working left to right. That said we're going to start by clicking the [Location] button.
- In this case we want to elevate every contour in our source file. By modifying the location boundary, you could import and elevate only a portion of your source data. Since I want to elevate everything I am going to select the "All" radio button, and click [Ok].
- The default is "Preview", but we want don't want to simply preview the elevated contours. We want Map 3D to actually import (draw) them in our new drawing. For that reason we're going to select the "Draw" radio button.
- Since our fundamental goal here is to change the elevation of AutoCAD linework, we want to "Alter Properties". Clicking the [Alter Properties] button will bring up yet another dialog which will allow us to tell AutoCAD what to modify.
- Much like the "Define Query" dialog, the "Set Property Alterations" dialog is packed with an endless array of options. In our case we're modifying the elevation of an AutoCAD object, so we'll select the "Elevation" radio button.
- At this point we have told AutoCAD that we want to elevate something, but we haven't told it what to elevate. This will be accomplished by clicking the [Expression] button in the lower right portion of the dialog.
- While it may be tempting to plus out the "Properties" portion of the resulting dialog, what we want is "Object Data". After all what we have to cue in on is the value of a field within our GIS data. This part will vary depending on the source of your data, but in my case I am going to plus things out until I find an field saying something about elevation.
- Once you have located the field containing elevation data for your contour data, press [Ok] to get out of the "Property Alteration Expression" dialog. Once back to the "Set Property Alterations" dialog, the "Expression" text box should have something in it now. Press the [Add] button to add it to your query. You should see the expression added under "Current Property Alterations" upon pressing [Add]
- Press [Ok] to get back to the "Define Query of Attached Drawings" dialog, the temptation will be to hit [Ok] once again. STOP - don't do that... yet. Instead press the [Execute Query] button. The amount of data in your source file will of course determine how long AutoCAD Map 3D takes to execute the query. A small site shouldn't take too long, whereas an entire locality will understandably take some time.
- When Map 3D finishes processing your data your command line will provide a quick report on what Map 3D did.
- Unless you're working in an environment where you actually use the Map Drawing Attach feature beyond the scope of this blog post, you'll likely want to detach your source drawing. To do that, simply right-click on the attached drawing (Map Task Pane) and select "Detach".
At this point clicking on any contour line will unveil the fact your topography now has elevation. HA - the world isn't flat after all!