FindConnectingEdges Example

Land Auto

FindConnectingEdges Example

Sub Example_FindConnectingEdge()
    
    ' This example returns the connecting edge for a given point
    ' in the first surface in the collection.
    Dim surf As AeccSurface
    Set surf = AeccApplication.ActiveProject.Surfaces.Item(0)
    
    ' Get point for calculating connecting edges
    Dim pnt As Variant
    pnt = ThisDrawing.Utility.GetPoint(, "Select point in the surface: ")
    
    ' Get edge points
    Dim edgePnts As Variant
    edgePnts = surf.FindConnectingEdge(pnt(0), pnt(1))
    
    Dim lineObj As AcadLine
    Dim startPnt(0 To 2) As Double
    Dim endPnt(0 To 2) As Double
    
    ' Draw a red line along edge
    startPnt(0) = edgePnts(0)
    startPnt(1) = edgePnts(1)
    startPnt(2) = edgePnts(2)
    endPnt(0) = edgePnts(3)
    endPnt(1) = edgePnts(4)
    endPnt(2) = edgePnts(5)
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPnt, endPnt)
    lineObj.Color = acRed
    
End Sub