Layer by Elevation (Contour Map Layering)
Have you ever wanted to change the highlighted (indexed) contour interval in AutoCAD? or even add an indexed interval? Here's a handy routine that will do that and a whole lot more. In this example, let's start out with a plain (monochrome) contour map. First, select all the contours, using standard AutoCAD selection tools, order is not important. The number of contours and their elevation range is displayed. If the contour map had an existing indexed interval, its layers and interval would have been displayed.
Next let's select a unique major and minor layer name, and specify the major contour interval. The "Layer" button at the bottom of the form will allow you to access the AutoCAD layer dialog if you would like to add or modify layers. Hit the "Apply" button for the desired changes to take affect.
In this next example, we are specifying an elevation range to change to a new layer. All the contours at elevation 5275 and up to elevation 5375 have been selected to change to a new layer "Elev Range" as shown in the red. Once again, hit the "Apply" button for the desired changes to take affect.
In this this example, we have chosen the "Color Array" option. We specify a range of AutoCAD colors and those colors will be assigned to each contour elevation. Once again, the selection order is not important. If the number of contours exceeds the number of available colors, the color range is cycled through again. This is extremely handy for detecting erroneous data contour elevation data when creating a digital terrain model from contours. Once again, hit the "Apply" button for the desired changes to take affect. Note: color array assign a color override to each line, this is changed back to bylayer when running the "By Interval" or the "By Range" option.
This download contains the raw source code, (LSP and DVB files) not some slower uncustomizeable compiled version. Unzip the downloaded file to your ...\support folder or anywhere in AutoCAD's path. AppLoad "ElevLayer.lsp" and type "ElevLayer" to execute. Please note, this routine was designed to be used with AutoCAD 2000-2009. AutoCAD 2010 and later require the download and installation of Microsoft VBA module from AutoDesk.