laptop and a wrench

不具合

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

最後に公開された状態: August 25, 2014 ArcGIS for Desktop
不具合 ID 番号 NIM038376
送信されましたSeptember 11, 2008
最終更新日June 5, 2024
適用対象ArcGIS for Desktop
見つかったバージョン9.3
オペレーティング システムWindows OS
オペレーティング システムのバージョンXP
ステータスNon-Reproducible

参考情報

No Public Explanation

対処法

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

再現の手順

不具合 ID: NIM038376

ソフトウェア:

  • ArcGIS for Desktop

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動