<?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: Create graphic objects from spatialquery result features and add these to the arc in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721496#M19229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks to me that your problem is that you're using the same element instance over and over inside your loop.&amp;nbsp; You need to create a new element with each loop iteration.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Dec 2013 12:17:51 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2013-12-20T12:17:51Z</dc:date>
    <item>
      <title>Create graphic objects from spatialquery result features and add these to the arcmap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721493#M19226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Experts,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey , i am new to arcobject so need a help... I have to display those points on arcmap that lies inside the envelope.I am explainingwhat i have done so far. I have one point feature class say featureclass having (lat/lon)detail.I opened it&amp;nbsp; and used one ARCGIS Snippet i.e. GetActiveviewFromArcmap() and constructed one envelope as mentioned below-:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Iactiveview pactiveview=GetActiveviewFromArcmap(m_application);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ienvelope penvelope=new EnvelopeClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;penvelope=pactiveview.extent;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;penvelope.QueryCoord(out minx, out miny,out maxX,out maxY);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ispatialfilter sp=New IspatialfilterClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sp.geometry=penvelope;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sp.geometryfield=featureclass.shapefieldname;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sp.spatialrel=esrispatialrelenum.esrispatialrelIntersects;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ifeaturecursor fc=featureclass.Search(sp,false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IgraphicContainer pgc;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ielement pElement;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pElement=new MarkerElementClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ipoint ppoint=new PointClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ifeature feature=featurecursor.NextFeature();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while(feature!=null)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{double x=Convert.ToDouble(feature.get_value(featureclass.fields.findfield("LAT")));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; double y=Convert.ToDouble(feature.get_value(featureclass.fields.findfield("LON")));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ppoint.PutCoord(x,y);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pElement.Geometry=ppoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ppoint.AddElement(pElement,0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pActiveview.Refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featurecursor.NextFeature();} &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is it is&amp;nbsp; displaying&amp;nbsp; only one graphic object(point) on arcmap though there are 19 features satisfying the spatial query.I want that when i click the tool all features (point)/graphic object display on map at once. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 09:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721493#M19226</guid>
      <dc:creator>cynthiasinha</dc:creator>
      <dc:date>2013-12-19T09:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create graphic objects from spatialquery result features and add these to the arc</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721494#M19227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need this inside your while loop, at the end.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;feature=featurecursor.NextFeature();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 12:54:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721494#M19227</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-12-19T12:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create graphic objects from spatialquery result features and add these to the arc</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721495#M19228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey i tried it but still the same output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any problem with graphic container or retrieving of spatial query result.I believe i have used the right approach but not able to understand why m not getting the expected result??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 03:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721495#M19228</guid>
      <dc:creator>cynthiasinha</dc:creator>
      <dc:date>2013-12-20T03:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create graphic objects from spatialquery result features and add these to the arc</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721496#M19229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks to me that your problem is that you're using the same element instance over and over inside your loop.&amp;nbsp; You need to create a new element with each loop iteration.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 12:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/create-graphic-objects-from-spatialquery-result/m-p/721496#M19229</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-12-20T12:17:51Z</dc:date>
    </item>
  </channel>
</rss>

