pqy_20一风
路人甲
路人甲
  • 注册日期2004-08-05
  • 发帖数52
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1827回复:4

程序出错,帮忙看看!

楼主#
更多 发布于:2006-03-24 23:18
<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>
喜欢0 评分0
wanilyer
路人甲
路人甲
  • 注册日期2004-12-29
  • 发帖数43
  • QQ
  • 铜币60枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2006-03-25 08:59
<P>pPoint 是不是空的没有初始化</P>
举报 回复(0) 喜欢(0)     评分
wanilyer
路人甲
路人甲
  • 注册日期2004-12-29
  • 发帖数43
  • QQ
  • 铜币60枚
  • 威望0点
  • 贡献值0点
  • 银元0个
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编辑过]
举报 回复(0) 喜欢(0)     评分
pqy_20一风
路人甲
路人甲
  • 注册日期2004-08-05
  • 发帖数52
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2006-03-25 09:25
在<STRONG><U><FONT style="BACKGROUND-COLOR: #dddddd" color=#2b2bd5>pPoint.PutCoords 前,</FONT></U></STRONG> pPoint 已经 new 过了
举报 回复(0) 喜欢(0)     评分
何熙颖
路人甲
路人甲
  • 注册日期2004-10-22
  • 发帖数71
  • QQ
  • 铜币439枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2006-03-29 15:23
你的程序本身没有,错就错在你所编辑的图层精度不够,无法进行识别。改正办法,通过arcCatalog修改该图层的域值的范围从而提高该图层的精度
举报 回复(0) 喜欢(0)     评分
游客

返回顶部