AcMapODColumnDefinition class

Land Desktop Development ARX CPP SDK

 

AcMapODColumnDefinition class

This class is defined in MapODColumn.h.

The AcMapODColumnDefinition class is used to create a column definition, which can then be passed to AcMapODTableDefinition::AddColumn to build a table definition. The column definition contains the column's data type, name, optional description, and default value.

Do not subclass from this class.

To create a column definition, you instantiate this class using the new operator and release memory allocated for it using the delete operator, as shown in the following example. For simplicity, routine error checking is not shown.

AcMapSession *mapApi = NULL;
AcMapProject *pProj = NULL;
AcMapODContainer *pODCont = NULL;
AcMapODTableDefinition *pTabDef = NULL;
AcMapODColumnDefinition *pColDef1 = NULL;
 
mapApi = AcMapGetSession();
mapApi->GetProject(pProj);
pProj->GetODContainer(pODCont);
pTabDef = new AcMapODTableDefinition();
pColDef1 = new AcMapODColumnDefinition();
pColDef1->SetName("Residential");
pColDef1->SetDescription("Residential R1-R3");
pColDef1->SetType(AcMap::kCharacter);
pColDef1->SetDefaultValue("R1");
pTabDef->AddColumn(*pColDef1);
pODCont->CreateODTable("MinimalTable", *pTabDef, "Simple table",
      Adesk::kFalse); 
   if (pColDef1) delete pColDef1; 
   if (pTabDef) delete pTabDef;