YouTube | Facebook | Twitter  Feed

IGxObjectFilter の利用

2016/9/1 (木)

Sub test()
    Dim pWorkspaceFactory As IWorkspaceFactory
    Set pWorkspaceFactory = New AccessWorkspaceFactory
    'Set pWorkspaceFactory = New ShapefileWorkspaceFactory
    'Set pWorkspaceFactory = New FileGDBWorkspaceFactory
    'Set pWorkspaceFactory = New FileGDBScratchWorkspaceFactory
    'Set pWorkspaceFactory = New InMemoryWorkspaceFactory
     
    Dim pWorkspaceName As IWorkspaceName
    Set pWorkspaceName = pWorkspaceFactory.Create("D:\Workspace", "Workspace", Nothing, Application.hWnd)
     
    Dim pName As IName
    Set pName = pWorkspaceName
     
    Dim pWorkspace As IWorkspace
    Set pWorkspace = pName.Open
     
End Sub
 
 
Sub gxdlg()
    Dim pEnumGx As IEnumGxObject
     
    'フィルタの作成
    Dim pShpFilter As IGxObjectFilter
    Set pShpFilter = New GxFilterShapefiles
     
    Dim pLyrFilter As IGxObjectFilter
    Set pLyrFilter = New GxFilterLayers
     
    Dim pGxDialog As IGxDialog
    Set pGxDialog = New GxDialog
    pGxDialog.Title = "データの参照"
     
     
    Dim pFilterCol As IGxObjectFilterCollection
    Set pFilterCol = pGxDialog
'    pFilterCol.AddFilter pShpFilter, False
'    pFilterCol.AddFilter pLyrFilter, True 'pLyrFilter is the default filter.
     
    If Not pGxDialog.DoModalOpen(0, pEnumGx) Then
        Exit Sub 'キャンセルを押した場合
    End If
    MsgBox pEnumGx.Next.FullName
     
End Sub

関連記事

  • この記事を書いた人

羽田 康祐

好きな地図投影法 はパース・クィンカンシャル図法とマクブライド・トーマス平極四次曲線図法。広島市出身。GIS上級技術者、Esri認定インストラクター、測量士補、潜水士、元PADIダイブマスター、四アマ。GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、発言は個人の見解です。

-プログラミング, ArcGIS
-,

© 2021 WINGFIELD since1981