In the following I will describe how to convert a .dwg file (e.g. from AutoCAD) to an ASCII DTM file with ArcGIS.
For the steps listed below you need ArcGIS with the Spatial Analyst extension enabled.
1. Open the .dwg file in an ArcGIS project and select only 'Polyline' to display. Check that 'Polyline' only contains contour lines. If other features exist, delete them or export the contour lines only as shape file from AutoCAD.
2. Open the 'Topo to Raster' Tool of the Spatial Analyst.
- Input feature data: Select the 'Polyline' of the .dwg file
- Field: Elevation
- Type: Contour
- Output surface raster: Select a folder and name for the output raster.
- Output cell size: The tool proposes a cell size depending on the difference between contour lines. Define the cell size you prefer.
- Primary type of input data: Make sure this field is set to 'CONTOUR'.
Press OK and the tool should output a raster that looks like:
3. Open the 'Raster to ASCII' tool. Select the raster as input data and a folder and name (file ending .asc) for the output raster.
The resulting file will look like the example below: