<?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: Get Feature Symbol in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222894#M5750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is not possible for a feature to have an ObjectId of -1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2012 16:53:51 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2012-02-08T16:53:51Z</dc:date>
    <item>
      <title>Get Feature Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222891#M5747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using this code to get the symbol associated with a feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IFeature feature = geoFeatureLayer.FeatureClass.GetFeature( geoFeatureLayer.FeatureClass.FeatureClassID );
geoFeatureLayer.Renderer.get_SymbolByFeature( feature );
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, now I have encountered a layer where "FeatureClassID = -1" and this code crashes with "ROW_NOT_FOUND."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The help says: "...IFeatureClass::FeatureClassID will always return -1 for Coverage and Shapefile feature classes."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I (sort of) understand that but how should I get the Symbol for that kind of feature?&amp;nbsp; Suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 16:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222891#M5747</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-02-08T16:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get Feature Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222892#M5748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;GetFeature() takes the ObjectId of the feature you want it to return.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 16:13:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222892#M5748</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-02-08T16:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get Feature Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222893#M5749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;GetFeature() takes the ObjectId of the feature you want it to return.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But it bombs if the ObjectId is -1. What do I do if my ObjectId = -1?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 16:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222893#M5749</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-02-08T16:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get Feature Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222894#M5750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is not possible for a feature to have an ObjectId of -1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 16:53:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222894#M5750</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-02-08T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get Feature Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222895#M5751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It is not possible for a feature to have an ObjectId of -1.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Where do I get the ObjectId? The help says, "Since IFeatureClass inherits from IObjectClass, you can also get the feature class ID from IObjectClass:: ObjectClassID." But that is -1 also&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 17:57:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222895#M5751</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-02-08T17:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get Feature Symbol</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222896#M5752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're confusing the id of a feature class with the id of a feature.&amp;nbsp; They aren't the same thing.&amp;nbsp; The id of a feature class uniquely identifies the feature class within the geodatabase.&amp;nbsp; This is why shapefiles and CAD files have a feature class id of -1 (which isn't a valid value for a geodatabase feature class id); they don't belong to a geodatabase.&amp;nbsp; These ids are used mainly by the geodatabase itself; you will rarely, if ever, need to use the id of a feature class for anything.&amp;nbsp; The id of a feature uniquely identifies that feature within a feature class.&amp;nbsp; For geodatabase feature classes, the feature id field is named ObjectId by default.&amp;nbsp; For shapefiles it is usually named FID.&amp;nbsp; You can see the feature ids by adding the feature class as a layer to ArcMap and opening the attribute table.&amp;nbsp; It is this feature id that you will need to pass into GetFeature to return a particular feature from the feature class.&amp;nbsp; You can then pass the feature into the SymbolByFeature method to get the symbol that is used to draw the feature in the map view.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 18:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-feature-symbol/m-p/222896#M5752</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-02-08T18:07:46Z</dc:date>
    </item>
  </channel>
</rss>

