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 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项