Teigha Mechanical: HoleChartCompleteTable and HoleChartOverviewTable creation

Alexandr Matvienko

November 14, 2017

HoleChartCompleteTable and HoleChartOverviewTable are parts of the complex entity HoleChart. Creation of HoleChart tables is an important step to make all components of HoleChart work correctly.


Create a HoleChartCompleteTable object and use the method setSymbolDefaults to set initial properties. Creation of a HoleChartOverview table is the same, so we will walk through creation of HoleChartCompleteTable and the same code will work for HoleChartOverview as-is. Use your current database (pDb) as an argument.

AcAmgHoleChartCompleteTablePtr pHCCT = AcAmgHoleChartCompleteTable::createObject();

The next step is to connect FilteredHoleChart and HoleChartCompleteTable. Set an origin point to the entity.

pHCCT->setOrigin(OdGePoint3d(715.0, 290.0, 0.0));

Set text properties for rows and the head of the table: text color and text size.

OdCmColor rowColor, headColor;

Set table properties: set gaps for rows and the head of the table, enable drawing of a table title and column captions, set line spacing in table rows, and set the table name.

pHCCT->setTitleText(L"My Title");

To enable column rendering, use setColumnVisibility. The first argument is the column type and the second one is the layout where the column will be available. Possible variants are kHide, kShowCartesian, kShowPolar, and kShowAll.

pHCCT->setColumnVisibility(AcMgHc::kUserItem, AcMgHc::kShowAll);

Next, a block is used to set column properties. The first argument in all of the methods is the column type. The second arguments are:

  • setWrapTest — Sets the wrap mode for data in column rows.
  • setColumnWidth — Sets the width for the column.
  • setCaptionAlignment, setDataAlignment — Sets the text alignment in cells of table rows and the heading.
  • setLockEditing — Enables editing mode for the column.
  • setDataType — Sets the data type (kNoneData, kText, kNumeric).
  • setPrecision — Sets the precision of numeric data in digits after the dot.
pHCCT->setWrapText(AcMgHc::kUserItem, false);
pHCCT->setColumnWidth(AcMgHc::kStd, 30.0);
pHCCT->setCaptionAlignment(AcMgHc::kDesc, Acm::kLeft);
pHCCT->setDataAlignment(AcMgHc::kUserItem, Acm::kRight);
pHCCT->setLockEditing(AcMgHc::kUserItem, true);
pHCCT->setDataType(AcMgHc::kDesc, AcMgHc::kNumeric);
pHCCT->setPrecision(AcMgHc::kDesc, 3);

Set the layer for HoleChartCompleteTable.