<?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 Getting element Width and Height values in [Properties -&amp;amp;gt; Size and Position] dialog? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-element-width-and-height-values-in/m-p/545356#M14766</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In ArcMap UI, when element selection tool is selected, right-clicking the graphic element shows popup menu, if we click "Properties" item the Properties dialog is shown. How could I programmatically get the same values as being shown in "Width" and "Height" fields at the "Size and Position" tab of the dialog? Assumed I have a particular IElement in the code, for which I have to find these values, and I need the solution to work with IMapSurroundFrame-based elements also. The screenshot is attached, sorry for non-English localization of the software, I hope it's clear enough what is needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Nov 2011 06:40:11 GMT</pubDate>
    <dc:creator>IvanLeontiev</dc:creator>
    <dc:date>2011-11-07T06:40:11Z</dc:date>
    <item>
      <title>Getting element Width and Height values in [Properties -&amp;gt; Size and Position] dialog?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-element-width-and-height-values-in/m-p/545356#M14766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In ArcMap UI, when element selection tool is selected, right-clicking the graphic element shows popup menu, if we click "Properties" item the Properties dialog is shown. How could I programmatically get the same values as being shown in "Width" and "Height" fields at the "Size and Position" tab of the dialog? Assumed I have a particular IElement in the code, for which I have to find these values, and I need the solution to work with IMapSurroundFrame-based elements also. The screenshot is attached, sorry for non-English localization of the software, I hope it's clear enough what is needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 06:40:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-element-width-and-height-values-in/m-p/545356#M14766</guid>
      <dc:creator>IvanLeontiev</dc:creator>
      <dc:date>2011-11-07T06:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting element Width and Height values in [Properties -&gt; Size and Position] dial</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-element-width-and-height-values-in/m-p/545357#M14767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ivan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code gets to the width and height of a graphic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the map and the graphics container for it
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMXDocument As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMXDocument = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMXDocument.FocusMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGraphicsContainer As IGraphicsContainer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGraphicsContainer = pMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the first element
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pElement As IElement
&amp;nbsp;&amp;nbsp;&amp;nbsp; pGraphicsContainer.Reset
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pElement = pGraphicsContainer.Next
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the name property and display
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pElementProperties As IElementProperties
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pElementProperties = pElement
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox pElementProperties.Name
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the width and height and display
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnvelope As IEnvelope
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnvelope = New Envelope
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pDisplay As IDisplay
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pDisplay = pMXDocument.ActiveView.ScreenDisplay
&amp;nbsp;&amp;nbsp;&amp;nbsp; pElement.QueryBounds pDisplay, pEnvelope
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox CStr(pEnvelope.Width), vbInformation, "width"
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox CStr(pEnvelope.Height), vbInformation, "height"
End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another Interface is IBoundsProperties. This code worked well for a circle but I noticed that when I drew a polyline graphic it's width was different to what the dialog was reporting, not sure why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:36:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-element-width-and-height-values-in/m-p/545357#M14767</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T16:36:33Z</dc:date>
    </item>
  </channel>
</rss>

