ArcObjects Library Reference (ArcMapUI)  

IMxDocument Interface

Provides access to members that control the Mx Document.

Product Availability

Available with ArcGIS Desktop.

Members

Description
Read-only property ActivatedView The activated view. This is the same as the active view unless a data frame is activated within a layout.
Read/write property ActiveView The active view.
Read-only property ActiveViewCommand The command associated with the active view.
Method AddLayer Adds a layer to the current focus map.
Method CanInsertObject Indicates if the document allows objects to be inserted.
Read-only property ContentsView The contents view at the specified index.
Read-only property ContentsViewCount The number of contents views in the document.
Read/write property ContextItem The last item that was right-clicked.
Read/write property CurrentContentsView The current contents view of the document.
Read/write property CurrentLocation The current mouse location in map units.
Read/write property DefaultColor The default color for the given type.
Read/write property DefaultTextFont The default font for text.
Read/write property DefaultTextFontSize The default font size for text.
Write-only property DelayUpdateContents Indicates document update notifications should be ignored.
Read-only property FocusMap The current focus map.
Method InsertObject Inserts an object into the document. Displays the insert object dialog.
Read-only property Maps The collection of maps in the document.
Read-only property OperationStack The operation stack.
Read/write property PageLayout The page layout.
Read/write property RelativePaths Indicates if path names are stored relative to the document.
Read-only property SearchTolerance The global search tolerance in geographic units for selection.
Read/write property SearchTolerancePixels The global search tolerance in pixels for selection.
Read-only property SelectedItem The selected item in the layer control.
Read-only property SelectedLayer The selected layer in the layer control.
Read-only property StyleGallery Reference to the document's Style Gallery.
Read-only property TableProperties Table properties, for Layers and Tables in ArcMap.
Method UpdateContents Notifies the document that the contents have been updated.

CoClasses that implement IMxDocument

CoClasses and Classes Description
MxDocument ESRI Mx Document.

Remarks

This interface is a starting point for much of the other objects in ArcMap.  For example, this interface provides access to the current active view, the currently selected map, all of the maps, and the style gallery.  This interface also has many properties reflected in the running application including: the text font, the text size, and the search tolerance.  Almost every ArcMap customization uses IMxDocument one way or another.

Obtain a reference to this interface via IApplication::Document.

To edit the contents of a map document saved to a file (*.mxd) outside of an ArcMap session or without instantiating a new Application (ArcMap process), see IMapDocument.  IMapDocument provides the ability to edit and save the contents of a map document.


   
 
         

.NET Snippets

Get MxApplication from ArcMap | Get Map from ArcMap | Get PageLayout from ArcMap | Get ActiveView from ArcMap | Open StyleManagerDialog | Get Contents View from ArcMap | Get MxDocument from ArcMap | TimeControl Playback | Open StyleReferencesDialog | Zoom to Active Layer in TOC | Set Data Source |

.NET Samples

Add a custom menu created in .NET to ArcGIS Desktop (Code Files: AddShapefile) | Applying a time offset to a time-aware feature layer (Code Files: TimeOffsetButton) | Brushing to create a selection (Code Files: BrushingVB) | Create a command by inheriting from BaseCommand (Code Files: ZoomToLayer) | Create a custom selection extension by extending ArcObjects (Code Files: SelectByLineTool SelectionExtension SelectionTargetComboBox ZoomToLayerMultiItem) | Create a custom tool (Code Files: DrawGraphicLine) | Curve conversion add-in (Code Files: CurveConversionDockWin) | Custom feedback tool and font drop-down list tool control (Code Files: FontToolControl ToolSample) | Custom selection extension (Code Files: SelectByLineTool) | Custom subtyped command and tool (Code Files: PolyFeedbackTools) | Custom UI elements using add-ins (Code Files: ZoomToLayerButton) | Implementing a schematic digitizing tool (Code Files: DigitTool) | Implementing an XML builder external component (Code Files: XMLDocImpl) | Layer filtering TOC view (Code Files: TOCLayerFilter) | Make a custom time slider (Code Files: CustomTimeSliderButton) | Migrating from VB6 to VB .NET for ArcGIS 10 (Code Files: clscopy_table_sel) | Network Analyst barrier location editor (Code Files: EditorForm) | Publish a map (Code Files: PublishMap) | Schematic diagram auto refresh (Code Files: FormAutorefresh) | Selection restriction evaluator (Code Files: SelectionRestrictionEvaluator) | Set the time extents for a layer then render the layer (Code Files: SetTimeExtentsButton) | StreetMap routing (Code Files: RoutingForm) | Subset network evaluators (Code Files: AutoUpdateNetworkElementArrayParametersCommand) | Time Series Graph tool add-in (Code Files: TimeSeriesGraph) | ViperPin tool (Code Files: ViperPinForm) |

.NET Related Topics

Accessing application and document objects | Adjusting feature locations with spatial adjustment | ArcMapUI | Create a command by inheriting from BaseCommand | Create a custom tool | DisplayUI | How to create AOIs and bookmarks | How to load data into a network analysis problem | How to wire custom events using IActiveViewEvents | LocationUI | Migrating VB6 to VB.NET for ArcGIS 10 | Performing basic map functions | SystemUI |