The MicroStationAPI provides an API for developers wanting to create custom applications for MicroStation® from Bentley Systems. We create a MicroStation application as a DLL, written using C++ and built with the Microsoft C++ compiler and linker provided with Visual Studio.
MicroStation CONNECT introduced the
Text Table,
represented in code by the TextTableElement
.
A TextTableElement
is a DGN graphic element.
You work on the content of a TextTableElement
using the TextTable
class.
This article
introduces you to the mechanism used to find TextTable
seeds.
Once you've found a seed, you want to clone it to create a new TextTable
.
Once you've found a seed, follow these steps to clone it …
TextTableElement
from the seed model
TextTable
from the TextTableElement
TextTable.CloneAsSeed()
to create a new TextTablePtr
TextTableCell
and settings its text
Writing programmatically …
/// CreateTable by cloning a seed TextTablePtr CreateTable (UInt32 nRows, UInt32 nCols, DgnModelP seedModel, DgnModelR activeModel) const { // Extract a TextTable from the seed model TextTablePtr seed = TextTableHelper::GetTableSeed (seedModel); // Clone the seed table to create a new TextTable in the context of the specified model TextTablePtr clone = seed->CloneAsSeed (nRows, nCols, activeModel); return clone; }
The above functionality is implemented in class TextTableHelper
.
You can
download the source code
(header & implementation files).
Post questions about C++ and the MicroStationAPI to the MicroStation Programming Forum.