通过比较模型空间的实体的数目差异来判断。
- Sub test()
-
- ' 返回当前模型空间的实体数目
- Dim n As Long
- n = ThisDrawing.ModelSpace.Count
-
- ' 调用Circle命令绘制圆
- ThisDrawing.SendCommand "circle 2,2,0 4 "
-
- ' 如果执行成功,则会生成新的实体
- Dim circleObj As AcadCircle
- If ThisDrawing.ModelSpace.Count > n Then
- Set circleObj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
- circleObj.Color = acRed
- End If
- End Sub
|