Hi,
anyone knows how to get sub elements from Grouped Holes, Complex Strings or Complex Shapes in NET API of Microstatioin CONNECT. I've tried with GetChildren() but always returns 0 elements.
many thanks,
you may want to check the CurveVector for an element, here a small code snippet to extract subelements from a complexShape
ComplexShapeElement cShape; //... CurveVector curve = cShape.GetCurveVector(); for (int i = 0; i < curve.Count; i++) { CurvePrimitive prim = curve.GetPrimitive(i); MessageBox.Show(prim.GetCurvePrimitiveType().ToString()); DEllipse3d arc; if (prim.TryGetArc(out arc)) { MessageBox.Show("Arc with Length (UOR): " + arc.ArcLength().ToString()); } }
I hope this helps?
Best regards,Artur
Answer Verified By: Francesc Calaf
Hi Artur,
many thanks. Another question, do you know how to get level name from Grouped Hole in CONNECT and NET API?
Hi artur,
Do you have any code snippets or suggestions how to extract geometry infomation from mesh or solid elements?
In previous MicroStation versions elements of type "Grouped Hole" were handled like a type 2 cell elements without providing level info for the cell instance element.With MSCE a Grouped Hole element also provides a level info, which obviously is missing in .NET API.The same result I can reproduce with COM API.
I have filed the Defect # 867376 to address this issue.
Hi Arrtur,
Artur Goldsweer said:which obviously is missing in .NET API.
maybe ElementGraphicsProcessor can help?
I tried it, but even though AnnounceElementDisplayParameters method is called for every "cell element" (boundary and groupped holes), it always reports boundary level name for all subelements, which is wrong, because in my example the holes are in a different level with different symbology.
But maybe another ElementGraphicsProcessor method should be overriden too?
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point