The MicroStation Development Library (MDL) and MicroStationAPI provide APIs 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.
When building your app, you can use Visual Studio or the Bentley Systems make (bmake) tools.
This article clarifies the process of finding element metrics — length, area or volume —
using the c++ MicroStationAPI.
The MicroStationAPI is huge, and delivered in multiple header (
*.fdf) files and
It's documented in several help files …
The help files are not cross-referenced. Sometimes it's tricky to discover the connection between one part of the API and another. to a task that would otherwise be simple.
If you're writing a .NET AddIn for MicroStation, using the DgnPlatformNET API, then look at this article.
The MicroStationAPI abstracts element mensuration
to the unpublished
Bentley Systems senior staffer
do exactly what you want and are just thin wrappers around
At some time, you probably want to show the results of mensuration to the MicroStation user. Bentley Systems provide several formatters documented in MicroStationAPI help. These formatters provide precise customisation possibilities of floating-point numbers and understand 1D, 2D and 3D quantities …
They each inherit from
Those formatters are simple to use: set your display preferences (e.g. decimal separator, thousands separator,
precision, units etc.), then call the
ToString (double numberToFormat) method …
#include <DgnPlatform/ValueFormat.h> double numberToFormat = 1234.456; DistanceFormatter formatter; // Initialised using active DGN model coordinate system ... modify formatter settings WString formattedResult = formatter.ToString (numberToFormat);
Post questions about C++ and the MicroStationAPI to the MicroStation Programming Forum.