阅读:2612回复:4
开发AE的小提示(C#)
<P>开发时写下列语句竟然出错</P>
<P> ESRI.ArcGIS.Geometry.IPoint pt = new ESRI.ArcGIS.Geometry.PointClass();<BR> pt.X += 30;</P> <P>一开始莫名其秒啊!!</P> <P>后来发现只要改成如下就OK了:</P> <P>pt.X = pt.X + 30;</P> <P>哈哈,应该是 += 操作符的原因了吧!希望大家注意!</P> |
|
1楼#
发布于:2006-12-04 17:21
<P>好像还是不对啊!</P>
<P>pt.X只可以赋值,不可取值!</P> <P>double d = pt.X;失败</P> <P>提示:the operation was attempted on an empty geometry.</P> <P>pt.X = 30;成功</P> |
|
2楼#
发布于:2006-12-04 17:34
<P>Points may be constructed using <a href="ms-help://ESRI.ArcGIS/esriGeometry/html/IPoint_PutCoords.htm" target="_blank" >PutCoords</A>, individually setting the X and Y properties, or using the <a href="ms-help://ESRI.ArcGIS/esriGeometry/html/IConstructPoint.htm" target="_blank" >IConstructPoint</A> interface.</P>
<P>必须用PutCoords构造才可以</P> <P>这么麻烦啊!不习惯!</P> |
|
3楼#
发布于:2006-12-05 01:15
<P>坏习惯</P>
<P>要不得</P> |
|
|
4楼#
发布于:2006-12-12 11:10
恩
|
|