TheSwamp

Code Red => .NET => Topic started by: sdunn on November 09, 2020, 11:19:46 AM

Title: Civil 3d is there a .net equivalent of COM surface.points
Post by: sdunn on November 09, 2020, 11:19:46 AM
I am updating old VBA code that creates a cogo point at each Tintriangle vertex.  In VBA the surface object had a points property that would give you a list of doubles that could be passed to a method in points.

VBA code:
Code - vb.net: [Select]
  1.     If (TypeOf oEnt Is AeccSurface) Then
  2.         Set oSurface = oEnt
  3.            
  4.         Dim vPoints As Variant
  5.         Dim cCount As Integer
  6.         vPoints = oSurface.Points
  7.         cCount = (UBound(vPoints) + 1) / 3
  8.         g_oDocument.Points.AddMultiple cCount, vPoints, 0
  9.        
  10.     Else
  11.         ThisDrawing.Utility.Prompt "A valid object was not selected"
  12.     End If

I am struggling to do this in .NET as I am not finding anything that exposes points other than getting the triangle collection, iterate each triangle, iterate each edge, collect point locations and the remove duplicates and finally add to the drawing as cogopoints.  I am hoping there is less complicated way to do this.

Thank you,
Stacy
Title: Re: Civil 3d is there a .net equivalent of COM surface.points
Post by: nobody on November 09, 2020, 10:00:18 PM
Looks like the surfaces have .GetVertices property

Title: Re: Civil 3d is there a .net equivalent of COM surface.points
Post by: sdunn on November 10, 2020, 01:37:58 PM
Thank you!