AutoVBA获取基本图元对象

AutoVBA获取基本图元对象,以LINE为例,代码如下。

Public Sub animatedline()
    Dim mylineobject As AcadLine
    Dim startmovevector(0 To 2) As Double
    Dim endmovevector(0 To 2) As Double
    Dim count As Integer, start As Single
    Set mylineobject = ThisDrawing.ModelSpace.Item(0)
    For count = 1 To 10
        startmovevector(0) = count
        startmovevector(1) = count
        startmovevector(2) = count
        endmovevector(0) = count + 1
        endmovevector(1) = count + 1
        endmovevector(2) = count + 1
        mylineobject.Move startmovevector, endmovevector
        start = Timer
        While Timer < start + 0.05
        Wend
        ZoomAll
        mylineobject.Update
    Next
End Sub

代码完。

图元对象就是基本的面向对象的思想,任何一个图元都是一个类的实例,绘图空间是各个类的实例显示的舞台。

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


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