<?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: Zoom to Point Feature and Set Scale in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243653#M6320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble zooming to a selected point.&amp;nbsp; My code selects the point just fine, but the code I used to zoom to a selected polygon does not work when I try applying it to a point.&amp;nbsp; I have separate buttons in my project, one executes the zoom to a selected polygon, while the other button is designed to execute a zoom to a selected point.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ' Now do the zoom to the selected features&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pSelSet As ISelectionSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pSelSet = pFeatureSelection.SelectionSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumGeom As IEnumGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumGeomBind As IEnumGeometryBind&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumGeom = New EnumFeatureGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumGeomBind = pEnumGeom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pEnumGeomBind.BindGeometrySource Nothing, pSelSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pGeomFactory As IGeometryFactory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pGeomFactory = New GeometryEnvironment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pGeom As IGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMxDoc.ActiveView.Extent = pGeom.Envelope&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pFeatureSelection.Clear&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMxDoc.ActiveView.Refresh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMxDoc.PageLayout.ZoomToWhole&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Sep 2010 20:22:25 GMT</pubDate>
    <dc:creator>MichaelKartusch</dc:creator>
    <dc:date>2010-09-29T20:22:25Z</dc:date>
    <item>
      <title>Zoom to Point Feature and Set Scale</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243651#M6318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am set up to zoom to a selected point through a button on a custom form.&amp;nbsp; My map centers on the point just fine.&amp;nbsp; I would like to zoom in on that point rather than remain at the scale I am at.&amp;nbsp; Say, zoom to a 2400 scale.&amp;nbsp; Is there a way that I can set that while zooming to my point?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Adam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 21:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243651#M6318</guid>
      <dc:creator>AdamVellutini</dc:creator>
      <dc:date>2010-04-22T21:48:34Z</dc:date>
    </item>
    <item>
      <title>Zoom to Point Feature and Set Scale</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243652#M6319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need to calculate the Extent, and then you can set IMap.Extent to zoom the map to a specific scale.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 04:42:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243652#M6319</guid>
      <dc:creator>SaqibMehmood</dc:creator>
      <dc:date>2010-04-23T04:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Point Feature and Set Scale</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243653#M6320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble zooming to a selected point.&amp;nbsp; My code selects the point just fine, but the code I used to zoom to a selected polygon does not work when I try applying it to a point.&amp;nbsp; I have separate buttons in my project, one executes the zoom to a selected polygon, while the other button is designed to execute a zoom to a selected point.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ' Now do the zoom to the selected features&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pSelSet As ISelectionSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pSelSet = pFeatureSelection.SelectionSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumGeom As IEnumGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumGeomBind As IEnumGeometryBind&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumGeom = New EnumFeatureGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pEnumGeomBind = pEnumGeom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pEnumGeomBind.BindGeometrySource Nothing, pSelSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pGeomFactory As IGeometryFactory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pGeomFactory = New GeometryEnvironment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pGeom As IGeometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMxDoc.ActiveView.Extent = pGeom.Envelope&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pFeatureSelection.Clear&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMxDoc.ActiveView.Refresh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pMxDoc.PageLayout.ZoomToWhole&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Sep 2010 20:22:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243653#M6320</guid>
      <dc:creator>MichaelKartusch</dc:creator>
      <dc:date>2010-09-29T20:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Point Feature and Set Scale</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243654#M6321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A single point will not have an envelope.&amp;nbsp; What you can do instead is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;create a new Envelope and set it to your activeView.Extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;center the Envelope on your point using Envelope.CenterAt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set your activeView.Extent to the modified Envelope&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;optionally modify the map scale&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;refresh &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use this in conjunction with your zoom to polygon code you could check the type of geometry, i.e.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If Geometry.GeometryType = esriGeometryPoint then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'center on point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'zoom to polygon/polyline/mutipoint etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End if&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 13:50:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/zoom-to-point-feature-and-set-scale/m-p/243654#M6321</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2010-09-30T13:50:11Z</dc:date>
    </item>
  </channel>
</rss>

