Sub AddVertexExample()
' This example creates a light weight polyline in model space.
' It then adds a vertex to the polyline.
Dim myDoc As IntelliCAD.Document
Dim myPline As IntelliCAD.LWPolyline
Dim myPoints As IntelliCAD.points
Dim pt As IntelliCAD.Point
Set myDoc = ActiveDocument
Set myPoints = Library.CreatePoints
Set pt = Library.CreatePoint(6, 2, 0)
myPoints.Add
myPoints(myPoints.Count).x = pt.x
myPoints(myPoints.Count).y = pt.y
myPoints(myPoints.Count).z = pt.z
Set pt = Library.CreatePoint(9, 7, 0)
myPoints.Add
myPoints(myPoints.Count).x = pt.x
myPoints(myPoints.Count).y = pt.y
myPoints(myPoints.Count).z = pt.z
Set myPline = ThisDocument.ModelSpace.AddLightWeightPolyline(myPoints)
myPline.Update
ThisDocument.ActiveViewport.ZoomAll
Dim newVertex As IntelliCAD.Point
Me.hide
Set newVertex = ThisDocument.Utility.GetPoint(, "Pick a point for a new vertex.")
myPline.AddVertex 2, newVertex
ThisDocument.ActiveViewport.ZoomAll
End Sub