谢谢上面两位的回复,我看过帮助里的这段程序,但是不太懂。他的意思是连接点吗(4,7,0) (5,7,0) (6,7,0) (4,6,0) (5,6,0) (6,6,6),但是程序运行后在autocad里显示不是这样。
AddMLine 示例 [明经通道 ActiveX 和 VBA 参考: AAR]Sub Example_AddMLine()
' 该示例在模型空间中添加多线。
Dim mLineObj As AcadMLine
Dim vertexList(0 To 17) As Double
' 定义新对象的数据
vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 6
' 在模型空间中创建多线
Set mLineObj = ThisDrawing.ModelSpace.AddMLine(vertexList)
ThisDrawing.Application.ZoomAll
MsgBox "已经在当前图形中添加了新的多线对象。"
End Sub
|