Create An Object Data Table

Land Desktop Map 3D Samples

 
Create An Object Data Table
 
 
 

This method takes two arguments: a table name and an MgClassDefinition object. It does the following:

  1. Uses the abstract class Autodesk.Gis.Map.HostMapApplicationServices to access theAutodesk.Gis.Map.MapApplication object, which represents the Map 3D application, to the get an Autodesk.Gis.Map.Project.ProjectModel object which represents the current active project belonging to this session.
  2. Uses the ProjectModel object to determine that there is no Object Data Table defined for this feature class.
  3. Uses the MgClassDefinition object to get the class property definitions (base class MgPropertyDefinition)
  4. Loops through the property definitions creating Autodesk.Gis.Map.ObjectData.FieldDefinition objects for each data property definition in the class (type MgDataPropertyDefinition), which has an MgPropertyType of String, Single, Double, Byte, Int16, or Int32. The MgPropertyType types are mapped to Autodesk.Gis.Map.Constants.DataType types: String to Character, Single and Double to Real, and Byte, Int16, and Int32 to Integer. Each FieldDefinition object is added to an Autodesk.Gis.Map.ObjectData.FieldDefinitions object.
  5. Uses the FieldDefinitions object to create an Autodesk.Gis.Map.ObjectData.Table object and adds the later to the ProjectModel object’s ODTables property.