<?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 Move legend to specific position in Layout View in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48885#M1248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcMap 9.3.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have written some automation processing for Layout creation and cannot seem to get the legend that is added programmatically to a specific position in the Layout View.&amp;nbsp; As seen in the attached image, it is added and is the correct size, but I need to place it as specified.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://i263.photobucket.com/albums/ii135/jamesfreddyc/lenendposition.jpg"&gt;&lt;IMG src="http://i263.photobucket.com/albums/ii135/jamesfreddyc/lenendposition.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the currnt "putcoord" parameters for the lengend:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
pEnv.PutCoords(0.4, 1.3, 1.75, 2.75)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the page size is 8.5x11 but in Landscape orientation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need to see the rest of the code that I am using to process this stuff, I can add more detailed snips.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;james&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Apr 2011 17:18:30 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2011-04-18T17:18:30Z</dc:date>
    <item>
      <title>Move legend to specific position in Layout View</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48885#M1248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcMap 9.3.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have written some automation processing for Layout creation and cannot seem to get the legend that is added programmatically to a specific position in the Layout View.&amp;nbsp; As seen in the attached image, it is added and is the correct size, but I need to place it as specified.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://i263.photobucket.com/albums/ii135/jamesfreddyc/lenendposition.jpg"&gt;&lt;IMG src="http://i263.photobucket.com/albums/ii135/jamesfreddyc/lenendposition.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the currnt "putcoord" parameters for the lengend:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
pEnv.PutCoords(0.4, 1.3, 1.75, 2.75)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the page size is 8.5x11 but in Landscape orientation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need to see the rest of the code that I am using to process this stuff, I can add more detailed snips.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;james&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 17:18:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48885#M1248</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2011-04-18T17:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Move legend to specific position in Layout View</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48886#M1249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;so the legend never moves no matter what the putcoords are? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my code for a creating/placing a legend (using putcoords to place it) is pretty long but i can post it up if it will help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 18:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48886#M1249</guid>
      <dc:creator>maxsteinbrenner</dc:creator>
      <dc:date>2011-04-18T18:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Move legend to specific position in Layout View</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48887#M1250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;so the legend never moves no matter what the putcoords are? &lt;BR /&gt;&lt;BR /&gt;my code for a creating/placing a legend (using putcoords to place it) is pretty long but i can post it up if it will help.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that is correct.&amp;nbsp; For example, if I replace the PutCoords line with this one, it simply resizes the legend (making it larger) and appears to keep the same position:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
pEnv.PutCoords(1, 1, 4, 4)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the full Sub that I am using to add the Legend:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub AddMapSurrounds()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pActiveView As IActiveView
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnv As IEnvelope
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pId As New UID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMapSurround As IMapSurround

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDoc = m_pApp.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pActiveView = pMxDoc.PageLayout
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnv = New Envelope
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnv.PutCoords(0.4, 1.3, 1.75, 2.75)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pId.Value = "esricore.Legend"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMapSurround = CreateSurround(pId, pEnv, "Index Reporting", pMxDoc.FocusMap, pMxDoc.PageLayout)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMapSurround.Refresh()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, Nothing, Nothing)

End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48887#M1250</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-10T21:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Move legend to specific position in Layout View</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48888#M1251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks to me like it needs to be something more like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; pEnv.PutCoords(9.0, 0.75, 10.35, 2.2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The parameters position the corners referencing zero as the lower left page corner:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LowerLeftX, LowerLeftY, UpperRightX, UpperRightY&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the size of the envelope is determined by the difference between the values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jeff H&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 19:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48888#M1251</guid>
      <dc:creator>JeffreyHamblin</dc:creator>
      <dc:date>2011-04-18T19:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Move legend to specific position in Layout View</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48889#M1252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Looks to me like it needs to be something more like:&lt;BR /&gt;&lt;BR /&gt; pEnv.PutCoords(9.0, 0.75, 10.35, 2.2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The parameters position the corners referencing zero as the lower left page corner:&lt;BR /&gt;&lt;BR /&gt;LowerLeftX, LowerLeftY, UpperRightX, UpperRightY&lt;BR /&gt;&lt;BR /&gt;So the size of the envelope is determined by the difference between the values.&lt;BR /&gt;&lt;BR /&gt;-Jeff H&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That looks pretty good to me, Jeff.&amp;nbsp; Thanks for the help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;james&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 19:16:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/move-legend-to-specific-position-in-layout-view/m-p/48889#M1252</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2011-04-18T19:16:25Z</dc:date>
    </item>
  </channel>
</rss>

