Public Sub test() ' Get the map and the graphics container for it Dim pMap As IMap Dim pMXDocument As IMxDocument Set pMXDocument = ThisDocument Set pMap = pMXDocument.FocusMap Dim pGraphicsContainer As IGraphicsContainer Set pGraphicsContainer = pMap ' Get the first element Dim pElement As IElement pGraphicsContainer.Reset Set pElement = pGraphicsContainer.Next ' Get the name property and display Dim pElementProperties As IElementProperties Set pElementProperties = pElement MsgBox pElementProperties.Name ' Get the width and height and display Dim pEnvelope As IEnvelope Set pEnvelope = New Envelope Dim pDisplay As IDisplay Set pDisplay = pMXDocument.ActiveView.ScreenDisplay pElement.QueryBounds pDisplay, pEnvelope MsgBox CStr(pEnvelope.Width), vbInformation, "width" MsgBox CStr(pEnvelope.Height), vbInformation, "height" End Sub
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.