clement 发表于 2006-4-12 16:18:00

为什么一定要等到窗体关闭以后所创建的实体才在图中出现

<P>新建一个窗体,加一个按钮CommandButton1,事件如下</P>
<P>Private Sub CommandButton1_Click()<BR>&nbsp; Dim varpnt As Variant<BR>&nbsp; Me.Hide<BR>&nbsp; varpnt = ActiveDocument.Utility.GetPoint(, "请给出圆心")<BR>&nbsp; ActiveDocument.ModelSpace.AddCircle varpnt, 10<BR>&nbsp; Me.show<BR>End Sub</P>
<P>在图中拾取圆心之后,所建的圆并没有在图中出现,而是需要等到窗体关闭</P>
<P>除了ActiveDocument.Regen acActiveViewport以外,请问还有没有更好的办法?</P>

esri 发表于 2006-4-12 21:36:00

<P>Private Sub CommandButton1_Click()<BR>&nbsp; Dim varpnt As Variant</P>
<P>&nbsp;&nbsp;dim pcircle&nbsp;As AcadCircle&nbsp; </P>
<P><BR>&nbsp; Me.Hide<BR>&nbsp; varpnt = ActiveDocument.Utility.GetPoint(, "请给出圆心")<BR>&nbsp; set pcircle = ActiveDocument.ModelSpace.AddCircle(varpnt, 10)</P>
<P>&nbsp;&nbsp; pcircle.update</P>
<P><BR>&nbsp; Me.show<BR>End Sub</P>

clement 发表于 2006-4-13 07:21:00

<P>谢谢</P>
页: [1]
查看完整版本: 为什么一定要等到窗体关闭以后所创建的实体才在图中出现