Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>IFrameElement is an interface, so you can't create an instance of it per se. This interface is implemented by <a href="http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriCarto/IFrameElement.htm" rel="nofollow noreferrer">various classes</a>, including MapFrame, which means (in basic terms) that an instance of any of those objects 'behaves' like an IFrameElement. So if you get an IFrameElement from IGraphicsContainer.FindFrame(), you can pass it to something else that expects an IFrameElement without having to find out what the actual type of the object is.</p> <p>I would suggest reading up on what Interfaces mean in OOP, because ESRI's code uses them <b>a lot</b>.</p> <p>On naming convetions - there is no hard &amp; fast rule on what to name your variables.</p> <p>By the looks of your code, the p refers to an object with a distinct type, and i refers to an object defined only by an interface. But on that note, calling a variable by the same name as the interface it's referencing (except with a lower-case 'i') is a bad way to do things, and will lead to confusion. (IMO)</p> <p><b>Edit:</b> To answer your final question (sorry, I missed it originally):</p> <p>If pGraphContLayout.FindFrame() returns an object of type MapFrame (and there is no guarantee that it does) then you should be able to simply cast it across to IMapGrids:</p> <pre><code>pGraphContLayout = CType(pLayout, esriCarto.IGraphicsContainer) pFrame = pGraphContLayout.FindFrame(pMxDoc.ActiveView.FocusMap) pGrids = CType(pFrame, IMapGrids) </code></pre> <p>It sounds like you may be getting confused by Python's abstract base classes, which seem to serve the purpose of interfaces...? This thread is useful: <a href="https://stackoverflow.com/questions/372042/difference-between-abstract-class-and-interface-in-python">Difference between abstract class and interface in Python</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload