laptop and a wrench

Error

When programatically switching between Pagelayout > Dataframe > back to Pagelayout, the dataframe shifts only in 9.3.

Última publicación: August 25, 2014 ArcGIS for Desktop
Número de ID del error NIM038376
EnviadoSeptember 11, 2008
Última modificaciónJune 5, 2024
Relacionado conArcGIS for Desktop
Versión encontrada9.3
Sistema operativoWindows OS
Versión de sistema operativoXP
EstadoNon-Reproducible

Información adicional

No Public Explanation

Solución alternativa

Instead of switching the activeview from pagelayout back to the focusmap. Set the focusmap of the activeview (in this case, the pagelayout) directly to that of the dataframe.Public Sub ZoomToSelectedWorkaround() Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pFSel As IFeatureSelection Set pFSel = pMxDoc.FocusMap.Layer(0) Dim pSelset As ISelectionSet Set pSelset = pFSel.SelectionSet ' Build a Geometry from the Selected Features Dim pEnumGeom As IEnumGeometry Dim pEnumGeomBind As IEnumGeometryBind Set pEnumGeom = New EnumFeatureGeometry Set pEnumGeomBind = pEnumGeom pEnumGeomBind.BindGeometrySource Nothing, pSelset Dim pGeomFactory As IGeometryFactory Set pGeomFactory = New GeometryEnvironment Dim pGeom As IGeometry Set pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom) pGeom.Project pMxDoc.FocusMap.SpatialReference ' Set the Active View's Extent to the Extent of the Selecected Features If TypeOf pMxDoc.ActiveView Is IPageLayout Then 'ESRI Added Dim pGC As IGraphicsContainer Set pGC = pMxDoc.ActiveView pGC.Reset 'instead of switching back to the data frame view, set the 'focusmap directly in the pagelayout Set pMxDoc.ActiveView.FocusMap = pMxDoc.Maps.Item(0) 'now need to zoom to selected features in focusmap in the pagelayout (activeview) 'instead of actually switching to the dataframe Dim pElement As IElement Set pElement = pGC.Next Do Until pElement Is Nothing If TypeOf pElement Is IMapSurroundFrame Then Dim pMapSurroundFrame As IMapSurroundFrame Set pMapSurroundFrame = pElement If <a href="http://pMapSurroundFrame.MapFrame.Map.Name" target="_blank">pMapSurroundFrame.MapFrame.Map.Name</a> = "Layers" Then Dim pAV As IActiveView Set pAV = pMapSurroundFrame.MapFrame.Map pAV.Extent = pGeom.Envelope End If End If Set pElement = pGC.Next Loop Set pMxDoc.ActiveView = pMxDoc.PageLayout Else pMxDoc.ActiveView.Extent = pGeom.Envelope End If Set pMxDoc.ActiveView = pMxDoc.PageLayout pMxDoc.ActiveView.RefreshEnd Sub

Pasos para reproducir

ID del error: NIM038376

Software:

  • ArcGIS for Desktop

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga