⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vba14-4.txt

📁 AO的原代码,都是以TXT的文件写的,对你肯定有帮助的.这些都是 我的心血啊.
💻 TXT
字号:
Private Function ZoomToSelected() As Boolean
    ' Zoom to the selection.
    Dim pMxDocument As IMxDocument
    Dim pMap As IMap
    Dim pActiveView As IActiveView
    Set pMxDocument = Application.Document
    Set pMap = pMxDocument.FocusMap
    ZoomToSelected = False
    ' Do not change the extent if there are
    ' no selected features.
    If pMap.SelectionCount > 0 Then
        Dim pEnumFeature As IEnumFeature
        Dim pFeature As IFeature
        Dim pEnvelope As IEnvelope
        ' Retrieve the selected features and
        ' get selections' extent.
        Set pEnumFeature = pMap.FeatureSelection
        pEnumFeature.Reset
        Set pFeature = pEnumFeature.Next
        Set pEnvelope = New Envelope
        Do While Not pFeature Is Nothing
            ' The new extent is combination
            ' of selected feature's extents.
            pEnvelope.Union pFeature.Extent
            Set pFeature = pEnumFeature.Next
        Loop
        pEnvelope.Expand 1.1, 1.1, True
        ' Set map's extent to the
        ' selections' extent.
        Set pActiveView = pMap
        pActiveView.Extent = pEnvelope
        pActiveView.Refresh
        ZoomToSelected = True
    End If
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -