ConTour Lisp Notes |
This routine creates 3D contour lines from 3D points.  It was written for Autocad 2000, so there's no guarantee it will work for you.
USE AT YOUR OWN RISK!
Previous update (11-10-11):  Prompt to check points before triangulating. See Option 1 Description.
Previous update (12-30-11):  Fixed contour line annotation error.
Previous update (6-5-12):  Added option to place contour annotations above lines without breaking contours.
Latest update (1-19-13):  Fixed cross section stationing error. Added alert when option 1 crashes. HELP!
Go to Download Page.
Unzip files to Autocad support directory or any directory in Autocad's search path.
Type (load"ctl_w8") at the command prompt to load routine. Type "CTL" at the command
prompt for option list.
Command: ctl
1. Draw Triangulated Surface.
2. Draw Contour Lines.
3. Swap Triangle Pairs.
4. Re-point Contour Lines.
5. Color Objects.
6. Read/Write CSV Point File.
7. Annotate Contours.
8. Create 3D Mesh.
S. Cross Sections from Contours.
A. Area Calculations.
Q. Quantity from Surface.
R. Replace Individual Points.
X. Import Excel Point File.
Option 1 creates a triangulated surface from all points found on layer "CTL_PNT".
It prompts to check points before the surface program runs. If any points are closer than 1.0
unit apart or there are duplicate points in the drawing, the program will hang. If too many of
your points are closer than 1 unit and you can't move or delete them, you'll have to scale all
of the points up to create the surface and then scale it back down to the original scale. The
check option will delete any duplicate points and draw a circle on layer "CTL_PTMP" around the
points closer than allowed.
More points don't necessarily create a better contour map but will only increase the dwg size.
Don't use any more points than the resolution you need. Option 6 or X import on layer CTL_PNT.
|
If you don't have any points, check out these DEM Point Selection programs.
If you need to change a space separated point file to a comma separated file, try one of these command line programs.
32 bit version s2csv32.exe <158kb>  or 16 bit version sp_2csv.exe. <14kb>  (8 character file names only.)
Option 2 draws plines thru each triangle surface on temporary layers, then selects
all lines on each elevation, joins them and asks if you want to create spline fit curves.
Spline curves take up a huge amount of drawing space and lose accuracy on sharp contour
corners if not enough points are supplied. If successfully joined/splined, it changes
each contour to layer CTL_CONT and deletes all temporary layers.
Option 3. You may need to swap triangles to force adjacent sides to run straight down
a ridge line or up a valley line. If you swap triangles, the program moves all points on
layer "CTL_PNT" to layer "CTL_PTMP". Every time you create a surface with option 1, the
program erases any existing surface created on layer "CTL_TIN". The points were moved so
you don't accidentally resurface and lose any swapped triangles. Just keep running option
2 until you get the contours the way you want. Option 2 automatically erases any existing
contours on layer "CTL_CONT" and re-contours.
|
Option 4 uses the MEASURE command to create more points along existing contour lines.
You may want to do this to create a more dense surface model to use with the 3D Mesh
option 8. More on that later. This option erases all existing points on layer "CTL_PNT"
so make sure you have a backup point file before using this option.
Option 5. This switches to a front view, uses the latest contour spacing with the left
and right limits to select and color contours. If you run this option before option 2,
it will prompt you for a spacing distance to use.
Option 6 imports any xyz comma separated point file onto layer "CTL_PNT" or writes any
selected points on layer "CTL_PNT" or "CTL_PTMP" out to a comma separated point file
and deletes all selected points from the drawing.
Option 7 annotates by picking a point on any contour line. It will prompt to either
break the contour line or place the text above the line. Drag the cursor to the right
to align the text. It will prompt you for a text size so you should check for clearance
between contours. It reads the elevation from the pick point so you don't have to type
anything. Occasionally it misreads the elevation by 1 and writes a wrong elevation like
5999 instead of 6000 (it's a fuzz factor error). I know it's painful but you might have
to manually fix this. The text is written at that elevation on layer "CTL_CTXT".
|
Option A calculates areas by using the boundary command. It uses the pick point
as the text location and will prompt for a text size. It temporarily displays a red
boundary and prompts you to accept or decline the area shown.
|
Go to Download Page.