A MicroStation DGN file is a container: it contains one or more DGN models. A DGN model is also a container: it contains DGN elements, reference attachments and other objects. XML files delivered with MicroStation define multiple schemas, known as ECSchemas, that define DGN element, model, file and other classes and properties.
The LASolutions::EcSegments
class attempts to model the structure of a hierarchy of EC classes and their properties.
Segments
is a property of any class that inherits from MstnLineSegments
.
MstnLineSegments.Segments
has an array of EC instances, each of which is an EC Segment
…
LASolutions::EcSegments
inherits from base classes LASolutions::EcDgnClass
and LASolutions::EcInheritanceChecker
.
They all live in the LASolutions
namespace.
Base class EcDgnClass
provides methods common to many EC classes, such as a property getter.
Base class EcInheritanceChecker
lets us check that the instance we have inherits from a particular EC class.
For example, the classes that have Segments
inherit them from EC class MstnLineSegments
.
If that condition is true, then we know that it's safe to get property Segments
, which is an array of Segment
instances.
struct EcSegments : EcDgnClass, EcInheritanceChecker { /// A collection of EcSegment. std::vectorsegments_; /// Construct an ecSegment object. EcSegments () : EcDgnClass (L"Segments"), EcInheritanceChecker (L"MstnLineSegments") {} EcSegments (ECN::IECInstancePtr instance) : EcDgnClass (L"Segments"), EcInheritanceChecker (L"MstnLineSegments") { Assign (instance); } /// Get the number of Segment objects we own. size_t Count () const { return segments_.size (); } /// Get the total length of Segment objects we own. double TotalLength () const; /// Trace this segments void Trace () const; void TraceProps () const; void TraceSegments () const; // Assign an EC instance to this class. bool Assign (ECN::IECInstancePtr instance) override; };
Read about the XXX class.
Post questions about C# and C++ to the MicroStation Programming Forum.