Hi,
what is the simplest way to obtain MicroStation element (ElementId is enough) from LinearElement?
For example, when there is an alignment, it is possible to iterate individual (linear) elements like line, arc, curves. In DGN, this geometry is represented by elements like line, B-spline curve, arc etc., grouped into complex chain. Is it possible to obtain information, using what MicroStation element the specific alignment part (LinearElement) is represented?
With regards,
Jan
LinearElement.GetCurveVector() can return us a MicroStation CurveVector object which we can extract any geometry information from it.
Actually LinearElement is NOT an Element, it is just a geometry. Its naming brings misunderstanding. Perhaps calling it LinearGeometry is better.
If your LinearElement came from an Alignment, then you can get an Element from an Alignment directly by using myAlignment.Element.
Hi Yongan,
thanks for your answer :-)
Yongan.Fu said:Actually LinearElement is NOT an Element, it is just a geometry.
Yes and no :-) I know the civil geometry is more like abstract model, represented by EC data. On the other hand, it is persisted as MicroStation element(s). And when some manipulations must be done (e.g. to copy a part of alignment, existing between two identified curves), it is necessary to jump the gap between civil model and MicroStation DGN format reality.
Yongan.Fu said:If your LinearElement came from an Alignment, then you can get an Element from an Alignment directly by using myAlignment.Element.
Yes, I know, but it is the whole alignment (I guess it is typically ComplexChain), not its part (e.g. CircularArc, represented by ArcElement).
I though about this way, but I have had not enough time yet to check what is the best way to access elements in the chain, as it is not "indexed container", and graphic processor returns (again) geometry only.
Yongan.Fu said:LinearElement.GetCurveVector() can return us a MicroStation CurveVector object which we can extract any geometry information from it.
Yes, I found this way already. But it looks like geometry position is lost: I have an alignment in some coordinates, but when converted to curve and new element is created from the curve, it is placed around 0,0. I plan to allocated some time to test when it happens: Whether geometry itself lost original coordinates, or when element is created, or maybe defined GCS plays some role here.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:But it looks like geometry position is lost: I have an alignment in some coordinates, but when converted to curve and new element is created from the curve, it is placed around 0,0.
Can you provide a very simple test case?
All my points came from my Civil programming colleague, I am not a ORD SDK expert.
Yongan.Fu said:Can you provide a very simple test case?
I will try to prepare something.
I am outside office this week, and I'd like to do a few more tests myself ... even when it does not lead to solution, it always bring better understanding of the topic and overall situation.
Regards,