HOW TO

Return ArcInfo coverage precision using VBA

Last Published: April 25, 2020

Summary

The IPropertySet.GetAllProperties method returns each property's value. The index of 0 contains the precision as a string.

Procedure



  1. Use an ArcInfoWorkspaceFactory object to create a pointer to 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 FeatureDataset object.

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



  3. Reference a PropertySet interface's GetAllProperties method. Two variant variables will be populated with the property names and values, respectively.

    Code:
    Dim props As Variant
    Dim vals As Variant
    pFeatureDataset.PropertySet.GetAllProperties props, vals


    Note:
    Since a FeatureDataset object is a type of Dataset object, and a PropertySet is associated with a Dataset, the PropertySet methods are available to the FeatureDataset.


  4. Return precision from the value variable's first index position (0).

    Code:
    MsgBox pFeatureDataset.Name & " " & props(0) & ": " & vals(0)

Article ID:000002405

Software:
  • ArcMap 8 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options