<?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: Some questions regarding CreateTextGraphicElement in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/some-questions-regarding-createtextgraphicelement/m-p/1599801#M12801</link>
    <description>&lt;P&gt;It seems that you are correct that the default behavior is indeed to position the TextGraphicElement using the bottom left corner - and then, when creating it, to update the anchor point using ElementInfo &lt;EM&gt;after&lt;/EM&gt; storing the point geometry.&amp;nbsp; The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic76411.html" target="_blank" rel="noopener"&gt;API reference has examples&lt;/A&gt; where the text element is repositioned immediately after creation (using the new anchor point in ElementInfo), but I've not found any time where a different anchor point is used for a Point Text Element during initial creation.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Coordinate2D propDesc_ll = new Coordinate2D(.5, .5);
CIMTextSymbol txtFormat = SymbolFactory.Instance.ConstructTextSymbol(
ColorFactory.Instance.BlackRGB, 10, "Arial");

//use ElementInfo to set placement properties during create
var elemInfo = new ElementInfo() { Anchor = Anchor.TopRightCorner };
            
TextElement propDescTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
    newLayout,
    TextType.PointText,
    propDesc_ll.ToMapPoint(), 
    txtFormat, 
    propertyData, 
    elementInfo: elemInfo) as TextElement; 
// elemInfo as optional parameter to set anchor

//Change the location using the new anchor position
propDescTxtElm.SetX(0.5);
propDescTxtElm.SetY(0.5);&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately, I'm unsure if that gives you the flexibility to control the size of the text area. A Rectangle Paragraph Text Element may&amp;nbsp; provide more control over the bounding area for text.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Mar 2025 00:58:35 GMT</pubDate>
    <dc:creator>GregC</dc:creator>
    <dc:date>2025-03-27T00:58:35Z</dc:date>
    <item>
      <title>Some questions regarding CreateTextGraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/some-questions-regarding-createtextgraphicelement/m-p/1594878#M12737</link>
      <description>&lt;P&gt;The "too long; didn't read" of all of this: What are the formatting options available for displaying text and how do you access them?&lt;BR /&gt;&lt;BR /&gt;For example, I have a CIMPage layout I'm working on that displays a few text blocks, a map, and a photograph. However, because CreateTextGraphicElement only seems to take a lower-left coordinate, I don't seem to have a way of limiting the final height of that text area. Example code is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Coordinate2D propDesc_ll = new Coordinate2D(.5, .5);
CIMTextSymbol txtFormat = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 10, "Arial");
TextElement propDescTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
                                newLayout, 
                                TextType.PointText, 
                                propDesc_ll.ToMapPoint(), 
                                txtFormat, 
                                propertyData) as TextElement;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the propertyData could have a little bit of text, or a lot. When it has a lot, it overlaps a map that is above it, such as the image below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="overlap.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127781i9640D70FA0CB9EA5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="overlap.png" alt="overlap.png" /&gt;&lt;/span&gt;(Ignore the white lines, just removing some personal data.) Now, once that's produced, I can click on the text area and resize it, but it'd be nice if it would either autosize, or I could calculate the size and resize it before placing (reducing the font size to make it fit, or whatever.)&lt;/P&gt;&lt;P&gt;Really, I guess I'd just like to give it an upper-right coordinate so that I could control the size. The attached file is the code for generating the layout.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 18:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/some-questions-regarding-createtextgraphicelement/m-p/1594878#M12737</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2025-03-12T18:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Some questions regarding CreateTextGraphicElement</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/some-questions-regarding-createtextgraphicelement/m-p/1599801#M12801</link>
      <description>&lt;P&gt;It seems that you are correct that the default behavior is indeed to position the TextGraphicElement using the bottom left corner - and then, when creating it, to update the anchor point using ElementInfo &lt;EM&gt;after&lt;/EM&gt; storing the point geometry.&amp;nbsp; The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic76411.html" target="_blank" rel="noopener"&gt;API reference has examples&lt;/A&gt; where the text element is repositioned immediately after creation (using the new anchor point in ElementInfo), but I've not found any time where a different anchor point is used for a Point Text Element during initial creation.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Coordinate2D propDesc_ll = new Coordinate2D(.5, .5);
CIMTextSymbol txtFormat = SymbolFactory.Instance.ConstructTextSymbol(
ColorFactory.Instance.BlackRGB, 10, "Arial");

//use ElementInfo to set placement properties during create
var elemInfo = new ElementInfo() { Anchor = Anchor.TopRightCorner };
            
TextElement propDescTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
    newLayout,
    TextType.PointText,
    propDesc_ll.ToMapPoint(), 
    txtFormat, 
    propertyData, 
    elementInfo: elemInfo) as TextElement; 
// elemInfo as optional parameter to set anchor

//Change the location using the new anchor position
propDescTxtElm.SetX(0.5);
propDescTxtElm.SetY(0.5);&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately, I'm unsure if that gives you the flexibility to control the size of the text area. A Rectangle Paragraph Text Element may&amp;nbsp; provide more control over the bounding area for text.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 00:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/some-questions-regarding-createtextgraphicelement/m-p/1599801#M12801</guid>
      <dc:creator>GregC</dc:creator>
      <dc:date>2025-03-27T00:58:35Z</dc:date>
    </item>
  </channel>
</rss>

