<?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: Label Only Selected Features? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177552#M4581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the API reference, both the LabelWhichFeatures method and WhereClause property should do what you need. Have you try to refresh the active view?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a KB article shows how to "Label selected features in ArcMap using ArcObjects". It uses the IAnnotateLayerProperties::WhereClause property. The only difference I see is the KB calls the IActiveView.Refresh method at the end.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/knowledgebase/techarticles/detail/21092"&gt;http://support.esri.com/en/knowledgebase/techarticles/detail/21092&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I apologize that the above KB is a very old one, however all the ArcObjects used in the KB hasn't been changed. So please give it a try. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Dec 2011 19:19:42 GMT</pubDate>
    <dc:creator>SiqiLi</dc:creator>
    <dc:date>2011-12-16T19:19:42Z</dc:date>
    <item>
      <title>Label Only Selected Features?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177551#M4580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, I've been labeling using the LabelEngine and simple expressions and it is working for every layer. I want to offer the option of labeling only selected features and thought it would be this simple:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;annotateLayerProperties.LabelWhichFeatures = esriLabelWhichFeatures.esriSelectedFeatures;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately that doesn't do it. Every polygon is still labeled. I verified that the features were selected (I have a routine that just returns the selected keys.) I also tried replacing the Engine labeling with a:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;annotateLayerProperties.WhereClause = BuildWhere( keyName, selected ); &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;using both my keys and the features OIDs - that does not label at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to label only the selected features?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2011 20:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177551#M4580</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2011-12-15T20:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Label Only Selected Features?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177552#M4581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the API reference, both the LabelWhichFeatures method and WhereClause property should do what you need. Have you try to refresh the active view?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a KB article shows how to "Label selected features in ArcMap using ArcObjects". It uses the IAnnotateLayerProperties::WhereClause property. The only difference I see is the KB calls the IActiveView.Refresh method at the end.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/knowledgebase/techarticles/detail/21092"&gt;http://support.esri.com/en/knowledgebase/techarticles/detail/21092&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I apologize that the above KB is a very old one, however all the ArcObjects used in the KB hasn't been changed. So please give it a try. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 19:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177552#M4581</guid>
      <dc:creator>SiqiLi</dc:creator>
      <dc:date>2011-12-16T19:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Label Only Selected Features?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177553#M4582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Already tried that suggestion. I don't think ArcGIS has the capability of labeling only selected features. My actual problem is worse that however.&amp;nbsp; The esriSelectedFeatures setting should work if you are then converting your label to an annotation but it is impossible to do that because my attributes are derived from a feature joined with a SQL Server table. I think I am stuck. :eek:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 19:48:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177553#M4582</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2011-12-16T19:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Label Only Selected Features?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177554#M4583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you clear the annotationproperties before applying new condition?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 20:34:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177554#M4583</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2012-01-09T20:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Label Only Selected Features?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177555#M4584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did you clear the annotationproperties before applying new condition?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it turns out that the .WhereClause will work but it will only work if I ensure that the field names are not delimited.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 21:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-only-selected-features/m-p/177555#M4584</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-01-09T21:26:54Z</dc:date>
    </item>
  </channel>
</rss>

