The EC classes mentioned here refer to those found in two EC schemas delivered with MicroStation...
BaseElementSchema.01.00.ecschema.xml
DgnElementSchema.01.00.ecschema.xml
A DGN Line Element has a corresponding EC class LineElement. A LineElement has property Segments, which owns an array of one or more Segment. Segments has property TotalLength, which makes sense. It also has property Area, which makes less sense since there's no obligation on Segments to make a closed loop.
LineElement
Segments
Segment
TotalLength
Area
A DGN Shape Element has a corresponding EC class ShapeElement, which inherits from MstnClosedBoundary. MstnClosedBoundary has property EnclosedArea. EnclosedArea applies only to closed elements, so is semantically valid.
ShapeElement
MstnClosedBoundary
EnclosedArea
But why does Segments have an Area property? If the segments don't form a closed loop then what is the meaning of Area? When is it appropriate to use the Area property of Segments?
Jon Summers said:But why does Segments have an Area property?
It looks like a relic (and maybe replaced by MstnClosedBounday.EnclosedArea property later) or was created for purpose outside normal MicroStation.
Jon Summers said:When is it appropriate to use the Area property of Segments?
Never? And who cares? ;-)
Theoretically, what there is an element and do not known anything about it, the first step should be to check if it inherits "MstnClosedBoundary" class, and when it does, EnclosedArea property contains the element area.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:first step should be to check if it inherits "MstnClosedBoundary" class, and when it does, EnclosedArea property contains the element area
That's exactly the approach I've taken.
A useful addition would be a property Planar, which would tell us if the segments lie on the same plane. Just wishful thinking...
Jan Šlegr said:who cares?
I do, which is why I asked the question. When we poke into these dusty corners of MicroStation, who knows what may pop up?
Regards, Jon Summers LA Solutions
Hi Jon,
baseElem:Segment doesn't have "Area" property. But baseElem:MstnLineSegments has "Area" property. If you look for "DgnElementSchema", many classes like "ShapeElement", "PlacementPointElement" etc., inherits this class. Looks like underlying handler of "baseElem:MstnLineSegments" has some commen functionality, that might have been used in derived implementations. Btw, baseElem:MstnLineSegments::Area property is also marked hidden, whereas EnclosedArea property, belonging to baseElem::MstnClosedBoundry is not hidden.
Do you see baseElem:MstnLineSegments::Area exposed in any Microstation UI, then it's a bug. Else, can you please let me what are you trying to achieve with it?
Thanks,
Mangesh
Answer Verified By: Jon Summers