Danh mục:

Lập trình ArcObject

Các bài hướng dẫn lập trình ArcObject

Bài 7 Get all Featuredatasets in Geodatabase

Code: Public Shared Function OpenFeaturedataset(ByVal workspace As IWorkspace) As DataTable Dim dt As New DataTable dt.Columns.Add(“Name”, GetType(String)) dt.Columns.Add(“Dataset”, GetType(Object)) Dim Emun As IEnumDataset = workspace.Datasets(esriDatasetType.esriDTFeatureDataset) Emun.Reset() Dim Ds As IDataset = Emun.Next While Not…

Bài 6. Kết nối CSDL – connect Geodatabase

Code: Public Shared Function Openworkspace(ByVal filename As String) As IWorkspace Dim extemtion As String = System.IO.Path.GetExtension(filename) If UCase(extemtion) = UCase(“.SHP”) Then Dim workspaceFactory As IWorkspaceFactory = New ShapefileWorkspaceFactoryClass Dim workspace As IWorkspace = workspaceFactory.OpenFromFile(System.IO.Path.GetDirectoryName(filename), 0) Return workspace ElseIf UCase…

Bài 5. Lấy danh sách layer đang mở

Bài 5. Lấy danh sách layer đang mở

Code: Dim pdatatable1 As New DataTable pdatatable1.Columns.Add(“Tenlayer”, GetType(String)) pdatatable1.Columns.Add(“Layer”, GetType(Object)) Dim pUID As IUID = New UIDClass() pUID.Value = “{6CA416B1-E160-11D2-9F4E-00C04F6BC78E}” Dim pMapLayers As IMapLayers = map Dim pEnumLayer As IEnumLayer = pMapLayers.Layers(pUID, True…