NumOldObj = ThisDrawing.ModelSpace.Count这句要在生成之前用,NumNewObj = ThisDrawing.ModelSpace.Count这句在生成之后用会有总是吗?我为此特地写了程式,结果不是你说的那样,会不一样的,如下
Private Sub UserForm_Click() Dim old As Integer, pt(2) As Double Dim cir As AcadCircle, ne As Integer pt(0) = pt(1) = pt(2) = 0# old = ThisDrawing.ModelSpace.Count Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 10) ne = ThisDrawing.ModelSpace.Count MsgBox old & vbCrLf & ne End Sub
|