📄 mod_file.bas
字号:
Attribute VB_Name = "Mod_File"
'Private m_pGxDialog As IGxDialog
Private m_pEnumObj As IEnumGxObject
Private m_pGxObj As IGxObject
Private m_pGxObjFlag As IGxObject
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'打开指定的MXD文件
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub OpenMxDocument(g_strFilePath As String)
If frmMDIMap.MapControl.CheckMxFile(g_strFilePath) Then
m_MxdPath = g_strFilePath
frmMDIMap.MapControl.LoadMxFile (g_strFilePath)
Dim i As Long
For i = 1 To 10
frmMDIMain.ActiveBar.Bands("ToolsBarFile").Tools("BarFileCheckView").CBAddItem "1:" + CStr(Int(frmMDIMap.MapControl.MapScale / i))
Next i
frmMDIMain.ActiveBar.Bands("ToolsBarFile").Tools("BarFileCheckView").Text = "1:" + CStr(Int(frmMDIMap.MapControl.MapScale))
frmMDIMain.ActiveBar.Refresh
m_pDocument.Open g_strFilePath
Call frmMDIMain.ReRefreshMapControl
Call frmMDIMain.ReInsertActiveBarTarget
Else
MsgBox g_strFilePath & " 不是一个有效的ArcMap文件!"
End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'新建的MXD文件
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub NewMxdDocument()
'打开对话框,选择要打开的MXD文件
On Error GoTo ErrorHand
frmMDIMain.CommonDialog.DialogTitle = "选择新建地图文档"
frmMDIMain.CommonDialog.Filter = "地图方档 (*.mxd, *.mxt, *.pmf)|*.mxd;*.mxt;*.pmf"
frmMDIMain.CommonDialog.ShowSave
If MsgBox("是否保存" + m_MxdFileName, vbYesNo) = vbYes Then
m_pDocument.Save
End If
m_pDocument.New frmMDIMain.CommonDialog.FileName
frmMDIMap.MapControl.LoadMxFile frmMDIMain.CommonDialog.FileName
ErrorHand:
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'保存的MXD文件
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub SaveMxdDocument()
'打开对话框,选择要打开的MXD文件
On Error GoTo ErrorHand
frmMDIMain.CommonDialog.DialogTitle = "选择地图文档"
frmMDIMain.CommonDialog.Filter = "地图方档 (*.mxd, *.mxt, *.pmf)|*.mxd;*.mxt;*.pmf"
frmMDIMain.CommonDialog.ShowSave
m_pDocument.SaveAs frmMDIMain.CommonDialog.FileName
ErrorHand:
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'显示选择对话框
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub GetSelection()
' 'Use mini-browser to get selected GxObjects. Your selections will be
' ' saved to "m_pEnumObj"
' Set m_pGxDialog = New GxDialog
' m_pGxDialog.AllowMultiSelect = True
' m_pGxDialog.DoModalOpen 0, m_pEnumObj
' 'Make sure that you will get a empty collection whenever you add new
' ' selections
' Set colTempObj = New Collection
'
' 'Add GxObjects in the enum "m_pEnumObj" to the collection colTempObj
' Set m_pGxObj = m_pEnumObj.Next
'
' If m_pGxObj Is Nothing Then
' ' Call addSDEData("james", "esri_sde", "sde", "sde", "", "SDE.DEFAULT")
' End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -