microgerm 发表于 2003-10-10 11:09:00

VBA的问题,请教各位高手!

我用VBA做了个窗体,上面有个BUTTON,目的是点击改按钮在图上花直线,但每次点击都出错,说AUTO CAD主窗体不可见,请问如何解决?

mccad 发表于 2003-10-10 12:10:00

这是按钮的点击事件,没有问题的:
Private Sub CommandButton1_Click()
    Dim P1(2) As Double
    Dim P2(2) As Double
    Dim Line As AcadLine
    P1(0) = 5: P1(1) = 5
    P2(0) = 25: P2(1) = 50
    Set Line = ThisDrawing.ModelSpace.AddLine(P1, P2)
    ThisDrawing.Regen acActiveViewport
End Sub
页: [1]
查看完整版本: VBA的问题,请教各位高手!