Dim m_appROT As ESRI.ArcGIS.Framework.IAppROT m_appROT = New ESRI.ArcGIS.Framework.AppROT Dim q As Object 'Cycle through appROT to work on the latest ArcMap open If m_appROT.Count > 0 Then For q = 0 To m_appROT.Count - 1 'If TypeOf m_appROT.Item(i) Is IGxApplication Then ' ArcCatalog running If TypeOf m_appROT.Item(q) Is IMxApplication Then ' ArcMap running If m_appROT.Item(q).Visible = True Then If m_appROT.Item(q).Document.Title = lblConnectedTo.Text Then pApp = m_appROT.Item(q) ' The session originally used. End If End If End If Next q End If
pObjectFactory = CType(pApp, IObjectFactory) pApp = pObjectFactory pDoc = pApp.Document pApp = pDoc.Parent pMxDoc = CType(pDoc, IMxDocument) pMap = CType(pMxDoc.FocusMap, IMap) ' Focus on the map Me.ArcGISApplication = pApp ' pass this to the public
Public WriteOnly Property ArcGISApplication() As ESRI.ArcGIS.Framework.IApplication Set(ByVal value As ESRI.ArcGIS.Framework.IApplication) m_application = value End Set End Property
ESRI.ArcGIS.Framework.IAppROT appRot = new ESRI.ArcGIS.Framework.AppROTClass(); For (int i = 0; i < appRot.Count; i++) { ESRI.ArcGIS.Framework.IApplication app = (ESRI.ArcGIS.Framework.IApplication)appRot.get_Item(i); if (app.Document is ESRI.ArcGIS.ArcMapUI.IMxApplication2) //FATAL ERROR HERE { IMxDocument mxDoc = app.Document as IMxDocument; ... more code
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.