<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can't access all annotation fields (feature cursor)? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493906#M13295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yeah that code is not going to work...&amp;nbsp; The messagebox call does an implicit cast of the value in the field to a string (calls default toString method.)&amp;nbsp; However if the value in the field is a null (dbnull.value) or a value that does not have a tostring method (i.e. geometry, blob, raster...), you will get an error for sure. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMap As IMap = My.ArcMap.Document.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDLayer As IFeatureLayer = pMap.Layer(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDFClass As IFeatureClass = pPIDLayer.FeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDFCursor As IFeatureCursor = pPIDFClass.Search(Nothing, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDFeature As IFeature = pPIDFCursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For i As Integer = 0 To 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if pPIDFeature.fields.field(i).type &amp;lt;&amp;gt; esriFieldTypeGeometry&amp;nbsp; andalso _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pPIDFeature.fields.field(i).type &amp;lt;&amp;gt;esriFieldTypeBlob andalso _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pPIDFeature.fields.field(i).type &amp;lt;&amp;gt;esriFieldTypeRaster andalso _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pPIDFeature.Value(i) isnot system.dbnull.value then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(pPIDFeature.Value(i))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code above assumes the table has more than 6 fields, otherwise it will also fail.&amp;nbsp; If you check the field types on the featureclass before doing the search, you can pass in a query filter with only the field names in the subfields that can be converted to a string and only query those fields.&amp;nbsp; You still have to check for nulls though...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One last thing, when posting to the forum that you have 'an error' it is useful to the forum to post the exact error message, that cuts out a lot of guessing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2013 19:56:41 GMT</pubDate>
    <dc:creator>AlexanderGray</dc:creator>
    <dc:date>2013-02-06T19:56:41Z</dc:date>
    <item>
      <title>Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493902#M13291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Obviously all tabular fields are typically available for read/write in a ifeaturecursor&amp;gt;ifeature object but the only ones available from an annotation feature class are the OBJECTID and FEATUREID.&amp;nbsp; How do I access others?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jan 2013 01:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493902#M13291</guid>
      <dc:creator>WesBailes</dc:creator>
      <dc:date>2013-01-26T01:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493903#M13292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bump...Suggestions anyone?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 00:40:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493903#M13292</guid>
      <dc:creator>WesBailes</dc:creator>
      <dc:date>2013-02-06T00:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493904#M13293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Where is the annotation stored (SDE, file gdb, etc.)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are all the fields visible when using arcCatalog or arcMap?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;bump...Suggestions anyone?&amp;nbsp; Thanks!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 18:34:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493904#M13293</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2013-02-06T18:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493905#M13294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Doesn't seem to matter.&amp;nbsp; I have tried both SDE and File GDB.&amp;nbsp; This code throws an error on the third iteration through the loop.&amp;nbsp; The first iteration yields the OBJECTID, the second the FEATUREID.&amp;nbsp; And yes, all fields are accessible through catalog and arcmap.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap = My.ArcMap.Document.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDLayer As IFeatureLayer = pMap.Layer(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDFClass As IFeatureClass = pPIDLayer.FeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDFCursor As IFeatureCursor = pPIDFClass.Search(Nothing, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDFeature As IFeature = pPIDFCursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i As Integer = 0 To 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(pPIDFeature.Value(i))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 18:49:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493905#M13294</guid>
      <dc:creator>WesBailes</dc:creator>
      <dc:date>2013-02-06T18:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493906#M13295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yeah that code is not going to work...&amp;nbsp; The messagebox call does an implicit cast of the value in the field to a string (calls default toString method.)&amp;nbsp; However if the value in the field is a null (dbnull.value) or a value that does not have a tostring method (i.e. geometry, blob, raster...), you will get an error for sure. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMap As IMap = My.ArcMap.Document.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDLayer As IFeatureLayer = pMap.Layer(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDFClass As IFeatureClass = pPIDLayer.FeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDFCursor As IFeatureCursor = pPIDFClass.Search(Nothing, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPIDFeature As IFeature = pPIDFCursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For i As Integer = 0 To 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if pPIDFeature.fields.field(i).type &amp;lt;&amp;gt; esriFieldTypeGeometry&amp;nbsp; andalso _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pPIDFeature.fields.field(i).type &amp;lt;&amp;gt;esriFieldTypeBlob andalso _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pPIDFeature.fields.field(i).type &amp;lt;&amp;gt;esriFieldTypeRaster andalso _&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pPIDFeature.Value(i) isnot system.dbnull.value then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(pPIDFeature.Value(i))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code above assumes the table has more than 6 fields, otherwise it will also fail.&amp;nbsp; If you check the field types on the featureclass before doing the search, you can pass in a query filter with only the field names in the subfields that can be converted to a string and only query those fields.&amp;nbsp; You still have to check for nulls though...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One last thing, when posting to the forum that you have 'an error' it is useful to the forum to post the exact error message, that cuts out a lot of guessing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 19:56:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493906#M13295</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-02-06T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493907#M13296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might be getting a type mismatch or something similar if you're trying to send the Shape field to a message box?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Doesn't seem to matter.&amp;nbsp; I have tried both SDE and File GDB.&amp;nbsp; This code throws an error on the third iteration through the loop.&amp;nbsp; The first iteration yields the OBJECTID, the second the FEATUREID.&amp;nbsp; And yes, all fields are accessible through catalog and arcmap.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap = My.ArcMap.Document.FocusMap&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDLayer As IFeatureLayer = pMap.Layer(0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDFClass As IFeatureClass = pPIDLayer.FeatureClass&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDFCursor As IFeatureCursor = pPIDFClass.Search(Nothing, False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pPIDFeature As IFeature = pPIDFCursor.NextFeature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i As Integer = 0 To 5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(pPIDFeature.Value(i))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 20:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493907#M13296</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2013-02-06T20:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can't access all annotation fields (feature cursor)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493908#M13297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for all of the suggestions!&amp;nbsp; I honestly don't know what I had done to not be able to edit those fields but I am now able to.&amp;nbsp; Appreciate all of the help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 12:02:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-access-all-annotation-fields-feature-cursor/m-p/493908#M13297</guid>
      <dc:creator>WesBailes</dc:creator>
      <dc:date>2013-02-08T12:02:53Z</dc:date>
    </item>
  </channel>
</rss>

