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
They contain a field called contour and are not Z or M aware.
-Steve
You would need to use the "Add CAD Fields" tool, then populate the appropriate fields before using the "Export to CAD" tool.
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