<?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: Place IGroupElement at Position XY in Layout in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387326#M10301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cheers for the info.&amp;nbsp; Part of the reason I wanted to move grouped data is that they are created dynamically and then need to be placed.&amp;nbsp; This means that figuring out the location and sticking the text in the middle was a major issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am now setting the location of the text inside a drawn box by using the font size and associated proportions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try and post the code if it holds up after testing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Oct 2011 00:10:26 GMT</pubDate>
    <dc:creator>HenryColgate</dc:creator>
    <dc:date>2011-10-17T00:10:26Z</dc:date>
    <item>
      <title>Place IGroupElement at Position XY in Layout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387324#M10299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know how to move a Group Element or even just a regular old ELement to a specific XY on the Layout View?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried setting it like I do for the Text Element below but just change ITextElement for IGroupElement and TextElementCLass for GroupElementClass :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Carto.IElement element = new ESRI.ArcGIS.Carto.TextElementClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Carto.ITextElement textElement = (ESRI.ArcGIS.Carto.ITextElement)element;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Geometry.IPoint point = new ESRI.ArcGIS.Geometry.PointClass();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point.X = 5;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point.Y = 10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; element_TableField.Geometry = point;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it fails with values outside expected range.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an easy way to set the Anchor Point to a specific XY coordinate on the Page Layout?&amp;nbsp; This would be really good if it can be moved as IElement so I can use it for everything.&amp;nbsp; It is painfully easy in Python but not being able to create Elements kind of ruined the good time I was having there...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 07:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387324#M10299</guid>
      <dc:creator>HenryColgate</dc:creator>
      <dc:date>2011-10-13T07:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Place IGroupElement at Position XY in Layout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387325#M10300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is a snippet from an implementation I have that places a TextElement onto a LayoutView.&amp;nbsp; From what I recall, it was kind of tricky to determine the actual coords for the PutCoords method of the IEnvelope and I just fiddled with it until I got it to the desired location, so hopefully someone can add to this posting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&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; 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; Dim pTextElement As ITextElement
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTextElement = New TextElement

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTextElement.Text = "blah, blah""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set font
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTextSym As IFormattedTextSymbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTextSym = New TextSymbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFont As stdole.IFontDisp
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFont = New stdole.StdFont
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFont.Name = "Times New Roman"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFont.Size = 23
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFont.Bold = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTextSym.Font = pFont

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTextElement.Symbol = pTextSym

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnv.PutCoords(4.5, 7, 4.5, 7) 'this was a bit tricky to specifically determine where to place

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pElem As IElement
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pElem = pTextElement
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pElem.Geometry = pEnv
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGc As IGraphicsContainer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGc = pMxDoc.PageLayout
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGc.AddElement(pElem, 0)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387325#M10300</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T17:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Place IGroupElement at Position XY in Layout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387326#M10301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cheers for the info.&amp;nbsp; Part of the reason I wanted to move grouped data is that they are created dynamically and then need to be placed.&amp;nbsp; This means that figuring out the location and sticking the text in the middle was a major issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am now setting the location of the text inside a drawn box by using the font size and associated proportions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try and post the code if it holds up after testing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 00:10:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387326#M10301</guid>
      <dc:creator>HenryColgate</dc:creator>
      <dc:date>2011-10-17T00:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Place IGroupElement at Position XY in Layout</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387327#M10302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like you can shuffle anything about using ITransform2D.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have used it to move my combined elements.&amp;nbsp; I assume it works for other map document Elements also.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This means that I just create the element off to the side one over the other and then shift it to the place on the map document I need it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 23:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/place-igroupelement-at-position-xy-in-layout/m-p/387327#M10302</guid>
      <dc:creator>HenryColgate</dc:creator>
      <dc:date>2011-10-30T23:34:56Z</dc:date>
    </item>
  </channel>
</rss>

