阅读:1827回复:4
程序出错,帮忙看看!
<P>当程序运行时,在如下代码处出错: </P>
<P>Do Until pFeature Is Nothing<BR> Set pEnve = pFeature.Extent<BR> <FONT style="BACKGROUND-COLOR: #dddddd"><FONT color=#2b2bd5><STRONG><U>pPoint.PutCoords pEnve.XMin, pEnve.YMin</U></STRONG></FONT> <FONT color=#d52b2b>’出错处</FONT><BR></FONT> pTextElement.ScaleText = True<BR> pTextElement.Symbol = pTextSymbol<BR> Set pGraphicElement = pTextElement<BR> Set pElement = pGraphicElement<BR> pElement.Geometry = pPoint<BR> pElementColl.Add pElement<BR> pFDOGraphicsLayer.DoAddElements pElementColl, 0<BR> pElementColl.Clear<BR> Set pFeature = pFCursor.NextFeature<BR> Loop</P> <P>提示错误为:“<FONT color=#c43c3c><EM><STRONG>The operation was attempted on an empty geometry</STRONG></EM>.”</FONT></P> <P><STRONG>其中,pFeature .FeatureType=esriFTAnnotation 。</STRONG>点pPoint 有值,试过 Set pPoint = pFeature.Shape,pElement.Geometry = pPoint 的方式,报出相同的错误。</P> <P>应怎样修改?</P> |
|
1楼#
发布于:2006-03-25 08:59
<P>pPoint 是不是空的没有初始化</P>
|
|
2楼#
发布于:2006-03-25 09:03
<P><FONT style="BACKGROUND-COLOR: #dddddd"><STRONG><U><FONT color=#2b2bd5>在这句</FONT></U></STRONG></FONT></P>
<P><FONT style="BACKGROUND-COLOR: #dddddd"><STRONG><U><FONT color=#2b2bd5>pPoint.PutCoords pEnve.XMin, pEnve.YMin</FONT></U></STRONG> </FONT></P> <P><FONT style="BACKGROUND-COLOR: #dddddd">的前面加上下面一句</FONT></P> <P>IPoint pPoint = new Point</P><br><br> [此贴子已经被作者于2006-3-25 9:05:32编辑过]
|
|
3楼#
发布于:2006-03-25 09:25
在<STRONG><U><FONT style="BACKGROUND-COLOR: #dddddd" color=#2b2bd5>pPoint.PutCoords 前,</FONT></U></STRONG> pPoint 已经 new 过了
|
|
4楼#
发布于:2006-03-29 15:23
你的程序本身没有,错就错在你所编辑的图层精度不够,无法进行识别。改正办法,通过arcCatalog修改该图层的域值的范围从而提高该图层的精度
|
|