[CE U13 .NET] Element Type 106 get Children

I prefer a solution for .NET but other Solutions are welcome too.

In my DGN I created a simple square and added some XAttribute Data to it. Then i extruded this element to a cube.
Calling the function GetChildren() gives me no result. I did called ExposeChildren before that but the result is false. Only when I give as reason the number 100 (cast to the enum), then I get a true as result but still no children.
I did read in a different thread that Bentley doesn't show the childrens for every Element. I only want to read data from that element and change them when necessary. When scanning the whole Model, I get that element with the data. Scanning the whole Model in that case is no option.

I did looked into the examples from the SDK but I didn't found something. I have no clue what to try next. I did tried to get the information via the Interop Element but because this is no Cell (can't convert to a cell), I dont have access to the Function to get the sub elements.
I mean there must be a solution to this without scanning the whole Model.

  • Hi Jean-Pierre,

    quick thought, not any tests done:

    Then i extruded this element to a cube.

    Type 106 is "generic type", so I assume when you will use standard GetChildren method (I think you mean Element.GetChildren()), you will receive nothing, because by extrusion you created some 3D element with internal structure, but with no children element(s).

    You should check what element type you created and to use proper ElementHandler (proper class in C#) and to check what methods are available.

    I only want to read data from that element and change them when necessary.

    An example of your DGN would help, because it's not clear whether attached XAttributes are atatched to "top level" element or they stayed with original element, but hidden inside the new element structure.

    With regards,

      Jan

  • test271119001.dgn

    I attached a dgn.

    The XAttributes stay with the old Element and I can access the XAttributes when getting that Element. The problem is that when I select the Element in the MicroStation, I only get the top most element, with no Information that there is more.

    You should check what element type you created and to use proper ElementHandler (proper class in C#) and to check what methods are available.

    The problem is that I won't know which Element I have there. Safely casting everything to every Element Type and check what gives me a result doesn't look right. With the Interop Element I have the functions IsCellElement() and so on to check the Element Type but with that Element, everything was false.

    Sure when doing something with that Element besides from accessing XAttributes and ECObject Data, then it would be necessary to get the proper Element Class.
    Mentioning ECObject Data, i also looked through them, if I find anything about the old Element but I had no luck.

    Mit freundlichen Grüßen / Best regards
    Jean-Pierre Hundhausen

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • Too busy and tired this weel, so shortly...

    The problem is that I won't know which Element I have there.

    Use standard C# approach:

    System.Type type = element.GetType();
    
    if (element is ExtendedElementElement)
    {
        ExtendedElementElement extElem = element as ExtendedElementElement;
    }

    if I find anything about the old Element but I had no luck.

    Did you try to use ElementGraphicProcessor? But I am not sure whether it's able to provide also internal not displayed objects (profile).

    Another way can be to use parametric solid classes to get original profile. LocateSubEntityTool is able to do that, but it's location tool, so it's more about to be inspired, not to use.

    With regards,

      Jan

  • I attached a dgn

    Use the ANALYZE ELEMENT key-in to examine your Type 106 element.  You can see that it has no children, but plenty of attributes. Note the Details tab, which has the comment element data not available...

    Cube 1 detail

    Cube Attributes

    Type 106 is a catch-all container that Bentley use to store advanced structures.  The geometry may not be advanced, but the contents may be complicated.  In this example, those attributes are presumably used to inform a BREP object.

     
    Regards, Jon Summers
    LA Solutions

  • Did you try to use ElementGraphicProcessor? But I am not sure whether it's able to provide also internal not displayed objects (profile).

    I don't know how to use it. There is no accessible Constructor and I found no function to get that Class. I searched through the SDK examples and through the docs but no helpful result.

    Another way can be to use parametric solid classes to get original profile. LocateSubEntityTool is able to do that, but it's location tool, so it's more about to be inspired, not to use.

    I didn't found anything about parametric solid. There is a Parametric Cell Element but this isn't one.

    Use the ANALYZE ELEMENT key-in to examine your Type 106 element.  You can see that it has no children, but plenty of attributes. Note the Details tab, which has the comment element data not available...

    I used the normal Element Information and there is the old Element. Because of that structure I assumed that this is a child element.


    I mean they are linked in some way and getting that information is the goal.

    Mit freundlichen Grüßen / Best regards
    Jean-Pierre Hundhausen

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • I don't know how to use it. There is no accessible Constructor

    ElementGraphicsProcessor

    public abstract class ElementGraphicsProcessor

    It's an abstract class ready for you to inherit to create a concrete class. Call your class from the ElementGraphicsOutput.Process method.

    I used the normal Element Information

    You should use both the Analyze Element and the Element Information tool.  Analyze Element is the older, but as you can see each tool provides a different set of information.

    I assumed that this is a child element

    Yes, but not a child in the sense that the API interprets a family.  The API will give you geometric children of a geometric DGN element.  Attributes are not children: rather, they are cousins made from data that are attached to a DGN element.

    There's also some misleading info in a Type 106.  The object may choose to render itself to graphics to help the user, even though the rendered graphics may not exist.  It's probably not obvious in your cube, because it's a simple structure.  Try extruding or rotating a curved profile to construct a more complex shape.  When MicroStation renders that object, you may see lines and arcs that don't exist in the BREP but are constructed for human consumption.

    Your ElementGraphicsProcessor can ask for those same data.

     
    Regards, Jon Summers
    LA Solutions

  • It's an abstract class ready for you to inherit to create a concrete class. Call your class from the ElementGraphicsOutput.Process method.

    What? I can create an empty class that inherits from ElementGraphicsProcessor. Calling ElementGraphicsOutput.Process does nothing in that context. Also Functions of the call ElementGraphicsProcessor doesn't have a function that looks promising.

    My expected result would be an Element or its ID. You can't tell me that it's so complicated to access these informations.

    Mit freundlichen Grüßen / Best regards
    Jean-Pierre Hundhausen

    |  AB_DATE Engineering  Software   |  ab-date.de  |

  • My expected result would be an Element or its ID

    If that's all you need, read this article about Model Scanning and Enumeration.

    The purpose of the ElementGraphicsProcessor is to harvest various information, both graphical and non-graphical, from a DGN model.  It's possible that the C++ implementation is more advanced than the .NET version, because it began its life in the MicroStation V8i era.  The C++ ElementGraphicsProcessor provides these methods...

    bool _ExpandPatterns ()
    Controls whether pattern graphics will be output.
    bool _ExpandLineStyles (ILineStyleCP lsStyle)
    Controls whether linestyle graphics will be output.
    bool _WantClipping ()
    Controls whether to output clipped graphics if any clipping is pushed by display.
    bool _ProcessAsFacets (bool isPolyface)
    Process surfaces and solids not handled directly or are clipped through _ProcessFaceta.
    bool _ProcessAsBody (bool isCurved)
    Process surfaces and solids not handled directly or are clipped through _ProcessBody.
    void _AnnounceContext (ViewContextR context)
    Supply the current context that is processing the geometry.
    void _AnnounceTransform (TransformCP trans)
    Supply the current transform that subsequent geometry is displayed through.
    void _AnnounceElemMatSymb (ElemMatSymbCR matSymb)
    Supply the current symbology that subsequent geometry is displayed with.
    void _AnnounceElemDisplayParams (ElemDisplayParamsCR displayParams)
    Supply the current symbology used to generate the ElemMatSym values.
    BentleyStatus _ProcessTextString (TextStringCR text)
    Collect output as text.
    BentleyStatus _ProcessCurvePrimitive (ICurvePrimitiveCR curve, bool isClosed, bool isFilled)
    Collect output as a single curve component.
    BentleyStatus _ProcessCurveVector (CurveVectorCR curves, bool isFilled)
    Collect output as a CurveVector.
    BentleyStatus _ProcessSolidPrimitive (ISolidPrimitiveCR primitive)
    Collect output as a solid primitive.
    BentleyStatus _ProcessSurface (MSBsplineSurfaceCR surface)
    Collect output as a bspline surface.
    BentleyStatus _ProcessBody (ISolidKernelEntityCR entity, IFaceMaterialAttachmentsCP attachments)
    Collect output for surfaces and solids using a solid kernel entity.
    BentleyStatus _ProcessFacets (PolyfaceQueryCR meshData, bool isFilled)
    Collect output for surfaces and solids as facets.
    IFacetOptionsP _GetFacetOptionsP ()
    Allow processor to override the default facet options.
    DrawPurpose _GetDrawPurpose ()
    Allow processor to override the default draw purpose.
    void _OutputGraphics (ViewContextR context)
    Allow processor to output graphics to it's process methods.

     
    Regards, Jon Summers
    LA Solutions

  • If that's all you need, read this article about Model Scanning and Enumeration.
    When scanning the whole Model, I get that element with the data. Scanning the whole Model in that case is no option.

    This would take too long with a lot of Elements in my case. Then I still have no clue about the connection between the 2 elements. That is an important information to get the right information's about the right Element.

    The purpose of the ElementGraphicsProcessor is to harvest various information, both graphical and non-graphical, from a DGN model.  It's possible that the C++ implementation is more advanced than the .NET version, because it began its life in the MicroStation V8i era.  The C++ ElementGraphicsProcessor provides these methods...

    The .NET Methodes look similar. I don't see any Method that gives me data, except GetFacetOptions and GetDrawPurpose (C++ only). Neither of them look right.

    Mit freundlichen Grüßen / Best regards
    Jean-Pierre Hundhausen

    |  AB_DATE Engineering  Software   |  ab-date.de  |