东博楠楠
路人甲
路人甲
  • 注册日期2009-03-23
  • 发帖数12
  • QQ357750979
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:3473回复:8

[原创]个人开发经验总结

楼主#
更多 发布于:2009-12-29 15:26
<P>从大学毕业一年半了,到这个单位工作从大三实习开始也两年多了,参与了国家的4个项目,也同时制作了很多数据生产工具,我自己觉得还是有些收获和成长,年底项目收尾没什么事情做,就依据开发帮助文档中的例子和代码,在我个人的理解上,并以一个中国人的思维方式,总结了一些经验吧。</P>
<P>可能高手觉得也就是这么一回事儿,不过我想对于一些新手来说,还是有一定的帮助,希望大家喜欢。</P>
<P>从2楼开始逐步更新,一楼用作目录吧就</P>
喜欢0 评分0
我要用自己的双足走在自己的双手铺设的轨道上!
东博楠楠
路人甲
路人甲
  • 注册日期2009-03-23
  • 发帖数12
  • QQ357750979
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2009-12-29 15:27
<H3 13pt 0cm 13pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><FONT face="Times New Roman"><FONT size=5>1.</FONT>      </FONT><FONT size=5>关于</FONT><A><FONT face="Times New Roman" size=5>IField</FONT></A><FONT size=5>接口(<FONT face="Times New Roman">esriGeoDatabase</FONT>)</FONT></H3>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IField</FONT>接口的第一个属性<FONT face="Times New Roman">AliasName</FONT>(只读,获得字段的别名)<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IField</FONT>接口的第二个方法<FONT face="Times New Roman">CheckValue</FONT>(<FONT face="Times New Roman">Value</FONT>)(方法,对于指定的属性字段,基于字段类型判断参数值是否有效,有效,则返回<FONT face="Times New Roman">True</FONT>,否则返回<FONT face="Times New Roman">False</FONT>)<p></p></P>
<P 0cm 0cm 0pt">例子代码:<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>'Get Field<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Set pField = pFields.Field(6)   <p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>bChkField = pField.CheckValue(45.86)   <p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>If bChkField = True Then<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>'Add data to selected rows for the field selected.<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>End If<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">IField</FONT>接口的其他属性均为只读属性,常用有<FONT face="Times New Roman">Name</FONT>(只读,获得字段的名称)<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>例子代码:<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim pFields As IFields<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim pField As IField<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim pGeoDef As IGeometryDef<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim pDomain As IDomain<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim i As Long<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Set pFields = pFeatClass.Fields<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>For i = 0 To pFields.FieldCount - 1<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>  Set pField = pFields.Field(i)<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>  If pField.Type = esriFieldTypeGeometry Then<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Set pGeoDef = pField.GeometryDef<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>  Else<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.AliasName<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.DefaultValue<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Set pDomain = pField.Domain<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Editable<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.IsNullable<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Length<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Name<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Precision<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Required<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Scale<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.Type<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>    Debug.Print pField.VarType<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>  End If<p></p></P>Next
我要用自己的双足走在自己的双手铺设的轨道上!
举报 回复(0) 喜欢(0)     评分
东博楠楠
路人甲
路人甲
  • 注册日期2009-03-23
  • 发帖数12
  • QQ357750979
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2009-12-29 15:28
<H3 13pt 0cm 13pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><FONT face="Times New Roman"><FONT size=5>2.</FONT>      </FONT><FONT size=5>关于</FONT><A><FONT face="Times New Roman" size=5>IFields</FONT></A><FONT size=5>接口(<FONT face="Times New Roman">esriGeoDatabase</FONT>)</FONT></H3>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IFields</FONT>接口的第一个属性<FONT face="Times New Roman">Field(Index) </FONT>(只读,以用于获取具体的字段,返回类型为<a href="http://www.gisempire.com/bbs/dispbbs.asp?boardid=62;id=73209;star=1#IField接口" target="_blank" ><FONT face="Times New Roman">IField</FONT></A>)<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IFields</FONT>接口的第二个属性<FONT face="Times New Roman">FieldCount</FONT>(只读,以用于获取属性的数量)<p></p></P>
<P 0cm 0cm 0pt">利用上面两个接口并用索引去依次循环获得每一列的属性<FONT face="Times New Roman">pField</FONT>(<FONT face="Times New Roman">Ifield</FONT>接口)<p></p></P>
<P 0cm 0cm 0pt">例子代码:<p></p></P><PRE><FONT face=宋体>Dim i As Long<p></p></FONT></PRE><PRE><FONT face=宋体>Dim pField As IField<p></p></FONT></PRE><PRE><FONT face=宋体>For i = 0 To (pFields.FieldCount - 1)<p></p></FONT></PRE><PRE><FONT face=宋体>    Set pField = pFields.Field(i)<p></p></FONT></PRE><PRE><FONT face=宋体>    Debug.Print pField.Name ; ": " ; pField.Type<p></p></FONT></PRE>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">Next i<p></p></FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IFields</FONT>接口的第三个方法<FONT face="Times New Roman">FindField(Name)</FONT>(方法,输入想要查找的属性域字段的名称,如果有,则返回该属性域字段在此<FONT face="Times New Roman">Fields</FONT>的索引,没有则返回<FONT face="Times New Roman">-1</FONT>)<p></p></P>
<P 0cm 0cm 0pt">例子代码:<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim i As Integer<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim pFields As IFields<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Dim pField As IField<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>'Get Fields<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Set pFields = pFeatClass.Fields<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>'Find the field named "average_income"<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>i = pFields.FindField("average_income")<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>'Set the current field<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>Set pField = pFields.Field(i)<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left>'Delete field from featureclass<p></p></P>
<P 0cm 0cm 0pt">pFeatClass.DeleteField pField<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IFields</FONT>接口的第四个方法<FONT face="Times New Roman">FindFieldByAliasName(Name)</FONT>(方法,与第三个方法类似,此时输入的为该列属性字段的别名,此方法不经常用)<p></p></P>
<P 0cm 0cm 0pt">例子代码:<p></p></P><PRE><FONT face=宋体>Dim i As Integer<p></p></FONT></PRE><PRE><FONT face=宋体>Dim pFields As IFields<p></p></FONT></PRE><PRE><FONT face=宋体>Dim pField As IField<p></p></FONT></PRE><PRE><FONT face=宋体>'Get Fields<p></p></FONT></PRE><PRE><FONT face=宋体>Set pFields = pFeatClass.Fields <p></p></FONT></PRE><PRE><FONT face=宋体>'Find the field with the aliasname "current population"<p></p></FONT></PRE><PRE><FONT face=宋体>i = pFields.FindFieldByAliasName("current population")<p></p></FONT></PRE><PRE><FONT face=宋体>'Set the current field<p></p></FONT></PRE><PRE><FONT face=宋体>Set pField = pFields.Field(i)<p></p></FONT></PRE><PRE><FONT face=宋体>'Delete field from featureclass<p></p></FONT></PRE>pFeatClass.DeleteField pField
我要用自己的双足走在自己的双手铺设的轨道上!
举报 回复(0) 喜欢(0)     评分
东博楠楠
路人甲
路人甲
  • 注册日期2009-03-23
  • 发帖数12
  • QQ357750979
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2009-12-29 15:31
<H3 13pt 0cm 13pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><FONT face="Times New Roman"><FONT size=5>3.</FONT>      </FONT><FONT size=5>关于<FONT face="Times New Roman">IPoint</FONT>接口(<FONT face="Times New Roman">esriGeometry</FONT>)</FONT></H3>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPoint</FONT>接口的第一个方法<FONT face="Times New Roman">PutCoords(X,Y)</FONT>(方法,设置该点的坐标)或者直接调用可以读写的属性<FONT face="Times New Roman">X</FONT>和<FONT face="Times New Roman">Y</FONT>,将坐标赋值给<FONT face="Times New Roman">X</FONT>和<FONT face="Times New Roman">Y<p></p></FONT></P>
<P 0cm 0cm 0pt">例子代码:<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">Dim pPoint As IPoint</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">Set pPoint = New Point</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">pPoint.PutCoords 100, 100</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPoint</FONT>接口的第二个方法<FONT face="Times New Roman">QueryCoords(X,Y)</FONT>(方法,得到该点的坐标)</P>
<P 0cm 0cm 0pt">例子代码:<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">Dim pPoint as IPoint</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">Dim dX as Double, dY as Double</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">pPoint.QueryCoords dX, dY</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPoint</FONT>接口的第三个方法<FONT face="Times New Roman">ConstrainAngle (constraintAngle, anchor, allowOpposite )</FONT>(方法,如果第三个参数<FONT face="Times New Roman">allowOpposite</FONT>为<FONT face="Times New Roman">True</FONT>,则将第二个参数<FONT face="Times New Roman">anchor</FONT>这个点作为一个原点,然后以第一个参数<FONT face="Times New Roman">constraintAngle</FONT>为与<FONT face="Times New Roman">x</FONT>轴的角度,做一条直线,再将调用此参数的点向该直线做垂线并交于一个新点,并将调用此方法的点移动到该点)<p></p></P>
<P 0cm 0cm 0pt"><v:shapetype><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype><v:shape><v:imagedata></v:imagedata></v:shape></P>
<P 0cm 0cm 0pt">例子代码:</P>
<P 0cm 0cm 0pt; TEXT-INDENT: 5.25pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan; mso-char-indent-count: .5" align=left>'Finds the closes point to line from (0,0) with angles<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left> 'defined by steps of pi/4 (Note all angles in radians)<FONT face="Times New Roman"> </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim pApoint As IPoint</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim pNpoint As IPoint</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim pi As Double</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim dAngle As Double</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim i As Long</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Set pApoint = New Point</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   pi = 4 * Atn(1)</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   dAngle = 0</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   pApoint.PutCoords 0, 0</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Set pNpoint = New Point</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   For i = 0 To 7</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">     pNpoint.PutCoords 1, 0</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">     dAngle = i * pi / 4</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">     pNpoint.ConstrainAngle dAngle, pApoint, True</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">     MsgBox "angle = " ; i ; "*pi/4" ; vbCrLf ; pNpoint.X ; "," ; pNpoint.Y</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Next i</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPoint</FONT>接口的第四个方法<FONT face="Times New Roman">ConstrainDistance (constraintRadius, anchor )</FONT>(方法,以第二个参数<FONT face="Times New Roman">anchor</FONT>这个点为圆心,然后以第一个参数<FONT face="Times New Roman">constraintRadius</FONT>为半径做一个圆,将调用此参数的点移动到该点与圆心做线段交于该圆的交点上)<p></p></P>
<P 0cm 0cm 0pt"><v:shape><v:imagedata></v:imagedata></v:shape></P>
<P 0cm 0cm 0pt">例子代码:</P>
<P 0cm 0cm 0pt; TEXT-INDENT: 5.25pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan; mso-char-indent-count: .5" align=left><FONT face="Times New Roman">Public Sub t_constraindistance()</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim pPoint As IPoint</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim pNPoint As IPoint</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Dim dRadius As Double</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Set pPoint = New Point</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   pPoint.PutCoords 0, 0</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman"> </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   Set pNPoint = New Point</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   pNPoint.PutCoords 2, 2</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   dRadius = 1.4142135623731</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   </FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   pNPoint.ConstrainDistance dRadius, pPoint</FONT></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; mso-pagination: widow-orphan" align=left><FONT face="Times New Roman">   MsgBox "Radius = " ; dRadius ; " x,y = " ; pNPoint.X ; "," ; pNPoint.Y</FONT></P> End Sub
我要用自己的双足走在自己的双手铺设的轨道上!
举报 回复(0) 喜欢(0)     评分
东博楠楠
路人甲
路人甲
  • 注册日期2009-03-23
  • 发帖数12
  • QQ357750979
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2009-12-29 15:31
<H3 13pt 0cm 13pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><FONT face="Times New Roman"><FONT size=5>4.</FONT>      </FONT><FONT size=5>关于<FONT face="Times New Roman" color=#ff0000>IPointArray</FONT>接口(<FONT face="Times New Roman">esriGeometry</FONT>)</FONT></H3>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPointArray</FONT>接口的第一个方法<FONT face="Times New Roman">Add(p)</FONT>(方法,向该类型的数组变量添加<FONT face="Times New Roman">Point</FONT>)<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPointArray</FONT>接口的第二个属性<FONT face="Times New Roman">Count</FONT>(只读,获得该数组变量中<FONT face="Times New Roman">Point</FONT>的个数,返回<FONT face="Times New Roman">Long</FONT>类型变量)<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPointArray</FONT>接口的第三个属性<FONT face="Times New Roman">Element(Index)</FONT>(只读,获得该数组变量中位于参数<FONT face="Times New Roman">Index</FONT>索引位置的点<FONT face="Times New Roman">Point</FONT>,返回一个<FONT face="Times New Roman">Point</FONT>类型的变量)<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPointArray</FONT>接口的第四个方法<FONT face="Times New Roman">Insert (Index, p )</FONT>(方法,向索引位置<FONT face="Times New Roman">Index</FONT>插入一个点<FONT face="Times New Roman">Point</FONT>)<p></p></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">IPointArray</FONT>接口的第五个方法<FONT face="Times New Roman">Remove (Index )</FONT>(方法,移除索引位置<FONT face="Times New Roman">Index</FONT>的点<FONT face="Times New Roman">Point</FONT>)<p></p></P>IPointArray接口的第六个方法RemoveAll(方法,移除所有在此数组中的点)
我要用自己的双足走在自己的双手铺设的轨道上!
举报 回复(0) 喜欢(0)     评分
ghl_729
外卖仔
外卖仔
  • 注册日期2004-03-05
  • 发帖数52
  • QQ29172636
  • 铜币278枚
  • 威望4点
  • 贡献值0点
  • 银元0个
5楼#
发布于:2010-01-07 08:52
<P>还是不懂 啊  有点晕 呵呵</P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
6楼#
发布于:2010-01-08 21:49
<P>不错的东西,对于初学者还是非常有帮助的</P>
<P>支持楼主继续更新</P>
举报 回复(0) 喜欢(0)     评分
a0513b502
路人甲
路人甲
  • 注册日期2008-02-18
  • 发帖数3
  • QQ
  • 铜币107枚
  • 威望0点
  • 贡献值0点
  • 银元0个
7楼#
发布于:2010-03-23 15:11
不错
举报 回复(0) 喜欢(0)     评分
dean1
路人甲
路人甲
  • 注册日期2006-01-31
  • 发帖数11
  • QQ
  • 铜币201枚
  • 威望0点
  • 贡献值0点
  • 银元0个
8楼#
发布于:2010-07-24 21:39
受教了<img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部