Sunday, May 31, 2009

How to Create Civil 3D Points for Each DEM Vertex - VBA

In a previous post I went over the steps to create COGO Points from a TIN surface without having to go in and turn on points and then extracting the points from the surface. I used the generic AeccSurface object to do this, which should have worked for other types of surfaces as well. There is a problem in the code when used with DEM surfaces. DEM surfaces tend to have a large amount of points and I was using an integer value when storing the number of points that needed to be added to the drawing. Well an integer value only goes up to 32767 in VBA, which as mentioned previously is easily exceeded with a DEM file. To fix the code the variable type needs to be changed that allows a larger number. In this case I’m going to go with a Double value which goes up to 1.79769313486232 E 308. So just change the Integer to Double and the code should work with DEM files.


No comments:


Blog Widget by LinkWithin