Sub Example_StartUndoMark()
' 这个例子演示了创建一系列的直线,每根直线都设置了取消标记。当所有直线创建完成后,可以运行命令“Undo”来单独取消一根直线。如果没有设置取消标记,则命令“Undo”将取消所有的直线。
Dim line As AcadLine
Dim stPnt(0 To 2) As Double
Dim endPnt(0 To 2) As Double
stPnt(0) = 1: stPnt(1) = 2: stPnt(2) = 0
endPnt(0) = 2: stPnt(1) = 1: stPnt(2) = 0
' 创建直线
Dim j As Integer
For j = 0 To 3
ThisDrawing.StartUndoMark
Set line = ThisDrawing.ModelSpace.AddLine(stPnt, endPnt)
stPnt(0) = stPnt(0) + 3
endPnt(0) = endPnt(0) + 3
ThisDrawing.EndUndoMark
Next
ZoomAll