laptop and a wrench

Bug

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

Zuletzt veröffentlicht: August 25, 2014 ArcGIS for Desktop
Bug-ID-Nummer NIM038376
EingereichtSeptember 11, 2008
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS for Desktop
Gefunden in Version9.3
BetriebssystemWindows OS
BetriebssystemversionXP
StatusNon-Reproducible

Zusätzliche Informationen

No Public Explanation

Workaround

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

Schritte zur Reproduzierung

Bug-ID: NIM038376

Software:

  • ArcGIS for Desktop

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln