.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VB.net C3D problem with SurfaceAnalysisContourdata

1 REPLY 1
Reply
Message 1 of 2
Anonymous
228 Views, 1 Reply

VB.net C3D problem with SurfaceAnalysisContourdata

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

1 REPLY 1
Message 2 of 2
Jeff_M
in reply to: Anonymous

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 

Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost