[quote user="Zhen Li"]I used type "MSElementUnion" in my older MDL application. But I can not find in the CONNECT SDK[/quote]
The large element union mselement was typedef'd to both MSElementUnion and MSElementin earlier versions of MicroStation. I don't think many of us used MSElementUnion, since it's just a longer name for that data type.
#include <DgnPlatformBaseType.r.h> #include <DgnElements.h>
With CONNECT the name of the element union is simply MSElement. Additionally, as with most of the C++ API, it's in a namespace. Its real name is DgnPlatform::MSElement. Taking advantage of the C++ language, it contains some methods, so you can ask questions like this...
DgnPlatform::MSElement el; ... get element from somewhere DgnPlatform::ElementId id = el.GetID (); bool isComplex = el.IsComplexHeader ();
You normally would eliminate the need for the namespace by writing a using statement. The SDK provides some namespace macros to make it easier to write them. In this case, USING_NAMESPACE_BENTLEY_DGNPLATFORM...
USING_NAMESPACE_BENTLEY_DGNPLATFORM; MSElement el; ... get element from somewhere ElementId id = el.GetID (); bool isComplex = el.IsComplexHeader ();