AutoCAD VBA 简单的绘制一条直线

AutoCAD VBA绘制一条直线,代码如下。

Public Function CreateLine()
Dim StartPoint(0 To 2) As Double
Dim EndPoint(0 To 2) As Double
StartPoint(0) = 0
StartPoint(1) = 0
StartPoint(2) = 0
EndPoint(0) = 100
EndPoint(1) = 0
EndPoint(2) = 0
With ThisDrawing.ModelSpace
.AddLine StartPoint, EndPoint
.Item(.Count - 1).Update
End With
End Function

代码完。

运行后会沿X轴绘制一条长度100的直线。

作者:codee
文章千古事,得失寸心知。


原文地址:https://www.cnblogs.com/bimgoo/p/2502903.html