Select to view content in your preferred language

How to export elevated contours to a dwg or dxf file

5455
3
01-05-2016 11:06 PM
EricSepich
New Contributor

Capture.PNG

import arcpy

from arcpy import env

///

arcpy.Contour_3d(inRaster, outContours, contourInterval, baseContour)

The above works however when I look at my contour lines in AutoCAD they contain no elevation. For some reason the command only works on the base raster layer which came from USGS if I plug in another layer (like a contoured vector layer) if fails with an error. I really need to have elevations so in AutoCAD so I can build a DTM

Tags (3)
0 Kudos
3 Replies
SteveLynch
Esri Regular Contributor

They contain a field called contour and are not Z or M aware.

-Steve

MikeCusi
Occasional Contributor II

You would need to use the "Add CAD Fields" tool, then populate the appropriate fields before using the "Export to CAD" tool.

0 Kudos
KarenHodge
Esri Contributor

Export to CAD will look for a field called "Elevation" and use that for Z values if the geometry is not itself Z aware.

You can do that by

- adding a new field and calculating it from your 'Contour' field.

Or

- setting an alias on your 'Contour' field of 'Elevation'.

Here's an article that talks about this:

31687 - Retain elevation values when converting from a shapefile to CAD 

0 Kudos