longcs 发表于 2003-11-6 14:44:00

非常谢谢zxj_76 ,不过我现在还在用r14,没有办法辣,只有自己想办法了

earchen 发表于 2003-11-14 21:02:00

R14下用vba开发和2000下有很大不同的
你应该用obj.erase命令的,还有ZoomAll应该这样用ThisDrawing.ActiveViewport.ZoomAll


Sub Example_Erase()
    ' This example creates a line and then erases it.
   
    Dim lineObj As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double

    ' Create the Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#

    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)

    ThisDrawing.Regen True
    MsgBox "The Line is created.", , "Erase Example"
   
    ' Erase the line
    lineObj.Erase
   
    ThisDrawing.Regen True
    MsgBox "The Line is erased.", , "Erase Example"
End Sub
页: 1 [2]
查看完整版本: vb写r14程序的一个问题