请教一个问题
<P>我用UserForm1.Show生成一个用户窗体,执行窗体代码生成实体,分别用NumOldObj = ThisDrawing.ModelSpace.Count和NumNewObj = ThisDrawing.ModelSpace.Count统计前后实体数量,但前后数量总是相同(实体确实已经生成了),怀疑是生成实体后图形未刷新,但加入ThisDrawing.Regen acActiveViewport也无济于事,我该怎么办?</P> <P>NumOldObj = ThisDrawing.ModelSpace.Count这句要在生成之前用,NumNewObj = ThisDrawing.ModelSpace.Count这句在生成之后用会有总是吗?我为此特地写了程式,结果不是你说的那样,会不一样的,如下</P><P>Private Sub UserForm_Click()<BR>Dim old As Integer, pt(2) As Double<BR>Dim cir As AcadCircle, ne As Integer<BR>pt(0) = pt(1) = pt(2) = 0#<BR>old = ThisDrawing.ModelSpace.Count<BR>Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 10)<BR>ne = ThisDrawing.ModelSpace.Count<BR>MsgBox old & vbCrLf & ne<BR>End Sub<BR></P> 谢谢回答,在调试状态总是对的,不过通过改变窗体的模态问题已解决,
页:
[1]