本例使用两个点 (5, 0, 0) 和 (1, 1, 0) 创建构造线对象。
Sub 两点创建构造线()
Dim xlineObj As AcadXline
Dim basePoint(0 To 2) As Double
Dim directionVec(0 To 2) As Double
' 定义构造线
basePoint(0) = 2#: basePoint(1) = 2#: basePoint(2) = 0#
directionVec(0) = 1#: directionVec(1) = 1#: directionVec(2) = 0#
' 在模型空间中创建构造线
Set xlineObj = ThisDrawing.ModelSpace.AddXline(basePoint, directionVec)
ThisDrawing.Application.ZoomAll
End Sub