<?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: How to get label text for each feature in vb.net in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427033#M11528</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks - I did actually start with those interfaces.&amp;nbsp; But there is no way to cursor through the records.&amp;nbsp; They simply lead to the Symboltext which is fine for getting the properties and the value for a single (random) text, but I could not figure out a way to cursor through all the records and get the text values.&amp;nbsp; I know there is a way, because the the KML export tool dumps the text values out into the kml file, and I can only assume that it was written using Arcobjects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2012 15:32:07 GMT</pubDate>
    <dc:creator>FredHejazi</dc:creator>
    <dc:date>2012-07-09T15:32:07Z</dc:date>
    <item>
      <title>How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427031#M11526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to get text for the label that Arcview is going to place for each feature when the labeling is on, so that I can write it to a file. Since the labels may have complex operations involved, I don't want to go to the attributes. Any help would be appreciated.&amp;nbsp; I am working in vb.net&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2012 15:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427031#M11526</guid>
      <dc:creator>FredHejazi</dc:creator>
      <dc:date>2012-07-06T15:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427032#M11527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fred,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have a look at the interfaces &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;IGeoFeatureLayer&lt;/SPAN&gt;&lt;SPAN&gt; and&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ILabelEngineLayerProperties2&lt;/SPAN&gt;&lt;SPAN&gt; this will get you started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 15:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427032#M11527</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2012-07-09T15:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427033#M11528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks - I did actually start with those interfaces.&amp;nbsp; But there is no way to cursor through the records.&amp;nbsp; They simply lead to the Symboltext which is fine for getting the properties and the value for a single (random) text, but I could not figure out a way to cursor through all the records and get the text values.&amp;nbsp; I know there is a way, because the the KML export tool dumps the text values out into the kml file, and I can only assume that it was written using Arcobjects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 15:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427033#M11528</guid>
      <dc:creator>FredHejazi</dc:creator>
      <dc:date>2012-07-09T15:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427034#M11529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks - I did actually start with those interfaces. But there is no way to cursor through the records. They simply lead to the Symboltext which is fine for getting the properties and the value for a single (random) text, but I could not figure out a way to cursor through all the records and get the text values. I know there is a way, because the the KML export tool dumps the text values out into the kml file, and I can only assume that it was written using Arcobjects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 15:36:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427034#M11529</guid>
      <dc:creator>FredHejazi</dc:creator>
      <dc:date>2012-07-09T15:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427035#M11530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fred,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OK this is how I did it in VBA. I added a layer and set a simple expression, see attached image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then the code below will will print out all the labels as you would see them on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Sub printLabels() &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get layer &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMXD As IMxDocument &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMXD = ThisDocument &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMXD.FocusMap &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer As ILayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLayer = pMap.Layer(0) &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeoFeaturelayer As IGeoFeatureLayer &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeoFeaturelayer = pLayer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get annotation collection &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pAnnotateLayerPropertiesCollection As IAnnotateLayerPropertiesCollection &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pAnnotateLayerPropertiesCollection = pGeoFeaturelayer.AnnotationProperties &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Assumes 1 item in collection &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pAnnotateLayerProperties As IAnnotateLayerProperties &amp;nbsp;&amp;nbsp;&amp;nbsp; pAnnotateLayerPropertiesCollection.QueryItem 0, pAnnotateLayerProperties, Nothing, Nothing &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get label engine and then the expression &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLabelEngineLayerProps As ILabelEngineLayerProperties &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLabelEngineLayerProps = pAnnotateLayerProperties &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim simpleExpression As String &amp;nbsp;&amp;nbsp;&amp;nbsp; Let simpleExpression = pLabelEngineLayerProps.Expression &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get expression engine and create parser &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pAnnotationExpressionEngine As IAnnotationExpressionEngine &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pAnnotationExpressionEngine = pLabelEngineLayerProps.ExpressionParser &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pAnnotationExpressionParser As IAnnotationExpressionParser &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pAnnotationExpressionParser = pAnnotationExpressionEngine.SetExpression("", simpleExpression) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ' Loop through featurelayer printing to VBA immediate window the label as seen on map &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureCursor As IFeatureCursor &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureCursor = pGeoFeaturelayer.Search(Nothing, True) &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeature As IFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pFeatureCursor.NextFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Do While Not pFeature Is Nothing &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print pAnnotationExpressionParser.FindLabel(pFeature) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pFeatureCursor.NextFeature &amp;nbsp;&amp;nbsp;&amp;nbsp; Loop End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 11:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427035#M11530</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2012-07-10T11:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427036#M11531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I converted your code to vb.net, which was essentially copy and paste.&amp;nbsp; And indeed that is the solution.&amp;nbsp; Thank you very much.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been banging my head against this for 4 days and was in the process of writing code to convert the lables to a temporary annotation layer and reading that as a featureset.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 14:42:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427036#M11531</guid>
      <dc:creator>FredHejazi</dc:creator>
      <dc:date>2012-07-10T14:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get label text for each feature in vb.net</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427037#M11532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fred,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was an interesting problem and something I have never done before so I was interested in finding out how to extract the information. All I've shown is how sad I am for knowing ArcObjects well enough to be able to answer the problem! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I am glad to have helped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2012 14:54:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-label-text-for-each-feature-in-vb-net/m-p/427037#M11532</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2012-07-10T14:54:39Z</dc:date>
    </item>
  </channel>
</rss>

