AppendVertex method example

Sub AppendVertex_Example()
' This example creates a polyline in model space and prompt the
' user to supply a new vertex. It then appends the new vertex to it.
    Dim myPoints(0 To 8) As Double
    myPoints(0) = 7: myPoints(1) = 2: myPoints(2) = 0
    myPoints(3) = 9: myPoints(4) = 8: myPoints(5) = 0
    myPoints(6) = 15: myPoints(7) = 8: myPoints(8) = 0
    Dim myPline As AcadPolyline
    Set myPline = ThisDrawing.ModelSpace.AddPolyline(myPoints)
    myPline.Update
    ThisDrawing.Application.ZoomExtents
    Dim newVertex As Variant
    'Note:GetPoint will display a rubberband from the last vertex
    '     myPoints(6) = 15: myPoints(7) = 8: myPoints(8) = 0
    '     which we can also pass as "15,8,0"
    newVertex = ThisDrawing.Utility.GetPoint("15,8,0", "Pick a point for a new vertex.")
    myPline.AppendVertex newVertex
    ThisDrawing.Application.ZoomExtents
End Sub

© Bricsys NV. All rights reserved.