Importing & Elevating GIS Contours – Part 2

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

  1. Start a new (blank) drawing
    You’re likely thinking “I already have a drawing”, but trust me – we need a new drawing.
  2. 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.
    image
  3. Right-Click on “Drawings”, and select “Attach”
    image
  4. 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.
    1. To set up a Drive Alias in Map 3D, click the image button at the top of the dialog.
    2. 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.
    3. Pressing Browse will allow you to specify your desired location.
      image
    4. Press Close, and your drive alias has been created.
  5. 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”
  6. 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.
    image

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.

  1. From the “Map Explorer” Map Taskpane Tab, right-click on “Current Query”, and select “Define”.
    image
  2. 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.
    image
  3. 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].
    image
  4. 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.
    image
  5. 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.
  6. 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.
    image
  7. 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.
  8. 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.
    image
  9. 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]
    image
  10. 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.  
  11. When Map 3D finishes processing your data your command line will provide a quick report on what Map 3D did. 
    image
  12. 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!

image

Donnie Gladfelter
Donnie Gladfelter

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.

22 Comments

  1. I followed your direction above until i get to selecting the “Object data”. The only thing I see is the the properties option, not the “Object data” as shown in your illustration.

  2. Donnie,

    How do you preserve the elevations in the contours after executing the query? I ran your procedures in Autodesk Land Enabled Map 2004 and everything worked fine, yet after when I detached the drawing from the session and reopened it, the elevation values were gone. I would like to preserve the elevation values so I can label the contours. Any input would be beneficial.

    Thanks,
    Michael Mark
    GIS/CAD Technician
    PCI

    • Michael –

      Just to recap; in Part 1 we imported the data. At this point the linework is 2D (doesn’t have a Z elevation). In this (Part 2) post we run a query to elevate the data. A common mistake I see a lot of users make is they don’t start a new blank DWG, they don’t select “Draw” under the Query mode, or they forget to alter properties (mapping to a data field).

      So the process looks something like this:
      1. Import the SHP file into Drawing 1
      2. Create a new Drawing 2
      3. Attach Drawing 1 to the empty/blank Drawing 2
      4. Define and execute the query (making sure your query mode is Draw, and you select the correct elevation field to modify the properties)
      5. Verify Map redrew the topo from Drawing 1
      6. Detach Drawing 1

  3. Donnie,

    How do you preserve the elevations in the contours after executing the query? I ran your procedures in Autodesk Land Enabled Map 2004 and everything worked fine, yet after when I detached the drawing from the session and reopened it, the elevation values were gone. I would like to preserve the elevation values so I can label the contours. Any input would be beneficial.

    Thanks,
    Michael Mark
    GIS/CAD Technician
    PCI

    • Michael –

      Just to recap; in Part 1 we imported the data. At this point the linework is 2D (doesn’t have a Z elevation). In this (Part 2) post we run a query to elevate the data. A common mistake I see a lot of users make is they don’t start a new blank DWG, they don’t select “Draw” under the Query mode, or they forget to alter properties (mapping to a data field).

      So the process looks something like this:
      1. Import the SHP file into Drawing 1
      2. Create a new Drawing 2
      3. Attach Drawing 1 to the empty/blank Drawing 2
      4. Define and execute the query (making sure your query mode is Draw, and you select the correct elevation field to modify the properties)
      5. Verify Map redrew the topo from Drawing 1
      6. Detach Drawing 1

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: