Here's a snippet of code I wrote for a routine that
automatically rebuilds the current surface and then spits out contours at
whatever contour interval ( my constant "cont_interval"). I use it for
grading on the fly, almost close to having dynamically updating contours, but I
still have to push a button. Haven't gotten around to adding any Events. This
will give you an idea how to generate contours though.
Fred
For cont = min_contour_elev To max_contour_elev
Step cont_interval
SurfOut.ElevationContours.Elevation =
cont
x =
SurfOut.ElevationContours.Count
If
x <> 0
Then
For j
= 0 To x -
1
cont_coords =
SurfOut.ElevationContours.Item(j).Coordinates
Set draw_cont =
ThisDrawing.ModelSpace.AddCustomObject("AeccDbContour")
draw_cont.Coordinates =
cont_coords
draw_cont.Layer =
"grading-contour"
If cont Mod 5 = 0
Then
draw_cont.Color =
acYellow
Else
draw_cont.Color =
acGreen
End If
Next j
End
If
Next cont