Civil 3D VB.net API

Civil 3D VB.net API

Anonymous
Not applicable
608 Views
1 Reply
Message 1 of 2

Civil 3D VB.net API

Anonymous
Not applicable
Here's a snipet of code I'm adapting from VBA to vb.net from one of the civil3d webcasts to adjust the elevation of points in a point group to a surface elevation.

Everything seems to be working except the following line of code:

Surf = m_oAeccApp.Surfaces

There seems to be a problem setting surf to the surfaces object.



Private Sub ButtonRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRefresh.Click
If IsNothing(m_oAcadApp) = False Then
m_oAeccApp = m_oAcadApp.GetInterfaceObject(m_sAeccAppProgId)
m_oAeccDoc = m_oAeccApp.ActiveDocument
m_oAeccDb = m_oAeccDoc.Database
'Populate Dropdowns
Dim PtGroup As AeccLandLib.AeccPointGroups
Dim PtGroupList() As Object
PtGroup = m_oAeccDoc.PointGroups
l = PtGroup.Count
ReDim PtGroupList(l - 1)
For m = 0 To l - 1
PtGroupList(m) = PtGroup.Item(m).Name
Next m
Me.ComboBoxPtGroup.Text = PtGroup.Item(0).Name
Me.ComboBoxPtGroup.DataSource = BubbleSort(PtGroupList)

Dim Surf As AeccLandLib.AeccSurfaces
Dim SurfList() As Object
Surf = m_oAeccApp.Surfaces
j = Surf.Count
If j > 0 Then
ReDim SurfList(j - 1)
For k = 0 To j - 1
SurfList(k) = Surf.Item(k).Name
Next
Me.ComboBoxSurf.DataSource = BubbleSort(SurfList)
Me.ComboBoxSurf.Text = SurfList(0)
Else : Me.ComboBoxSurf.Text = ""
End If


End If
'End population of dropdowns

End Sub
End Class



Thanks in advance
0 Likes
609 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
The line of code in question should be:

Surf = m_oAeccDoc.Surfaces
0 Likes