Hello,
I've got a routine that gets the surface, I can rename the surface, get the min and max elevations,...
But when i want to add a ContourData there is a problem.
I set up a SurfaceAnalysisContourdata (see code below), when I try to add the maximum elevation to the array I get the error "Object reference not set to an instance of an object"
Dim cdata(0) As SurfaceAnalysisContourData cdata.Initialize() With cdata(0) .MaximumElevation = TextBox1.Text 'Maximum surface elevation .MinimumElevation = TextBox2.Text 'Minimum surface elevation With .ContourValue .MajorColor = Autodesk.AutoCAD.Colors.Color.FromRgb(0, 0, 255) .MajorLineTypeId = ltbl("Continuous") .MajorLineWeight = LineWeight.LineWeight025 .MinorColor = Autodesk.AutoCAD.Colors.Color.FromRgb(0, 0, 255) .MinorLineTypeId = ltbl("Continuous") 'HIDDEN .MinorLineWeight = LineWeight.LineWeight018 End With End With
Someone has a clue?
Regards
Peter
Two things. 1.: There is a C3D specific customization forum where you will likely get more help with the C3D API : http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/bd-p/190
Second, I don't use VB much, but I think you need to set the object after you Dim it:
Dim cdata(0) As SurfaceAnalysisContourData = New SurfaceAnalysisContourData