<?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 cast a shape field from a table as a polygon, line or point feature shape in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-shape-field-from-a-table-as-a/m-p/269458#M6909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am doing a search by attributes on a feature class and when I retrieve the whoe, record I would like to get the information in the attributes tables under Shape as a Point shape to obtain the X and Y coordinates.&lt;BR /&gt;&lt;BR /&gt;How can I do that?&lt;BR /&gt;&lt;BR /&gt;I am using VB.net&lt;BR /&gt;&lt;BR /&gt;thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry im not familiar with vb.net but here you have c# sample I wrote in my utility:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//let's assume you've already used some kind of searching in the feature class and you get the featurecursor
//shape of the feature class is Point, but you can do it with polyline and polygon too 
IFeature feature = featCursor.NextFeature();
while (feature != null)
{
 IPoint point = (IPoint)feature.Shape;
 double X = point.X;
 double Y = point.Y;
 double Z = point.Z;
 //more logic
 ...
 feature = featCursor.NextFeature();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MDruzgala&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:11:16 GMT</pubDate>
    <dc:creator>MarcinDruzgala</dc:creator>
    <dc:date>2021-12-11T13:11:16Z</dc:date>
    <item>
      <title>How to cast a shape field from a table as a polygon, line or point feature shape fiel</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-shape-field-from-a-table-as-a/m-p/269457#M6908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am doing a search by attributes on a feature class and when I retrieve the whoe, record I would like to get the information in the attributes tables under Shape as a Point shape to obtain the X and Y coordinates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using VB.net&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 23:37:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-shape-field-from-a-table-as-a/m-p/269457#M6908</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2013-02-14T23:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to cast a shape field from a table as a polygon, line or point feature shape</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-shape-field-from-a-table-as-a/m-p/269458#M6909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am doing a search by attributes on a feature class and when I retrieve the whoe, record I would like to get the information in the attributes tables under Shape as a Point shape to obtain the X and Y coordinates.&lt;BR /&gt;&lt;BR /&gt;How can I do that?&lt;BR /&gt;&lt;BR /&gt;I am using VB.net&lt;BR /&gt;&lt;BR /&gt;thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry im not familiar with vb.net but here you have c# sample I wrote in my utility:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//let's assume you've already used some kind of searching in the feature class and you get the featurecursor
//shape of the feature class is Point, but you can do it with polyline and polygon too 
IFeature feature = featCursor.NextFeature();
while (feature != null)
{
 IPoint point = (IPoint)feature.Shape;
 double X = point.X;
 double Y = point.Y;
 double Z = point.Z;
 //more logic
 ...
 feature = featCursor.NextFeature();
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MDruzgala&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:11:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-shape-field-from-a-table-as-a/m-p/269458#M6909</guid>
      <dc:creator>MarcinDruzgala</dc:creator>
      <dc:date>2021-12-11T13:11:16Z</dc:date>
    </item>
  </channel>
</rss>

