乐筑天下AutoCad ActiveX 和VBA 中示例:
Sub Example_Coordinate()
' This example creates a polyline in model space and
' queries and changes the coordinate in the first index position.
Dim plineObj As AcadPolyline
Dim points(0 To 14) As Double
' Create a lightweight Polyline object in model space
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
ZoomAll
' Find the coordinate in the first index position
Dim coord As Variant
coord = plineObj.Coordinate(0)
MsgBox "The coordinate in the first index position of the polyline is: " & coord(0) & ", " _
& coord(1) & ", " & coord(2)
' Query the new coordinate
coord = plineObj.Coordinate(0)
MsgBox "The coordinate in the first index position of the polyline is now: " & coord(0) & ", " _
& coord(1) & ", " & coord(2)