English

How To: Build coverage topology in ArcMap using VBA

Summary

This sample VBA code builds coverage topology.

Procedure

  1. Use an ArcInfoWorkspaceFactory object to open the coverage's workspace.

    '++ Create a pointer to the data's workspace:
    Dim pWorkspaceFact As IWorkspaceFactory
    Set pWorkspaceFact = New ArcInfoWorkspaceFactory
    Dim pWorkspace As IWorkspace
    Set pWorkspace = pWorkspaceFact.OpenFromFile("c:\geodata\covers", 0)
    Dim pFeatureWorkspace As IFeatureWorkspace
    Set pFeatureWorkspace = pWorkspace

  2. Open the coverage as a Dataset object.

    Dim pDataset As IFeatureDataset
    Set pDataset = pFeatureWorkspace.OpenFeatureDataset("covername")

  3. Use the ICoverage:Build method to build the coverage.

    Dim pCoverage As ICoverage
    Set pCoverage = pDataset 'QI for ICoverage from IDataset
    Dim ptype As esriCoverageFeatureClassType
    ptype = esriCFCTPolygon
    pCoverage.Build ptype, "polygon"


    Note:
    For more information, see the Coverage Specific Interfaces on the Geodatabase Object Model (Supplemental).