你应该用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]