Author Topic: Civil 3d is there a .net equivalent of COM surface.points  (Read 1498 times)

0 Members and 1 Guest are viewing this topic.

sdunn

  • Newt
  • Posts: 90
Civil 3d is there a .net equivalent of COM surface.points
« 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
« Last Edit: November 09, 2020, 11:35:40 AM by sdunn »

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Civil 3d is there a .net equivalent of COM surface.points
« Reply #1 on: November 09, 2020, 10:00:18 PM »
Looks like the surfaces have .GetVertices property


sdunn

  • Newt
  • Posts: 90
Re: Civil 3d is there a .net equivalent of COM surface.points
« Reply #2 on: November 10, 2020, 01:37:58 PM »
Thank you!