[MStn CE / 2023 C#] Read alignment start station outside OpenRail Designer?

Hi,

I hope somebody from Bentley team will be able to advice me.

I am not sure whether it is better to ask here (because data is created in OpenRail Designer) or in MicroStation Programming forum (because it is where I need to access data), but I guess this forum is better.

The situation is:

  • In DGN file, there is alignment with assigned start station. The alignment comes from OpenRail Designer.
  • In MicroStation, I need to read geometry (no problem, including geometrical approximation of transition curves by B-splines) and start station (which I am not able to implement).

What I found so far:

  • Stationing is stored as StationingEntity_Presentation EC Class, that is defined in CivilSchema.
    The schema is not delivered with product, but created ad-hoc.
  • The EC data is stored as type 66 (application elements)
  • In OpenRail Designer, I am able, using several jumps (ECRelationshipClasses) navigate from alignment to the station data.
  • But, in MicroStation, using the same data, the last relationship is missing (from StationingEntity to StationingEntity_Presentation), so the presentation data cannot be read (although they are stored at the same element).

To obtain relationships, I use code similar to this one:

instance.SelectClause = new SelectCriteria(true);
DgnSelectAllRelationshipsAccessor.SetIn(instance.SelectClause.ExtendedDataValueSetter, true);
IECRelationshipInstanceCollection relationships = instance.GetRelationshipInstances();

foreach (...)

My question is:

  • I assume the problem is that CivilSchema is managed by code, not available in MicroStation. Is there any way to read existing data (as EC or plain XML), even when they are not published by DgnECManager.
  • As a workaround, is it possible to access application data (type 66) directly? Key is required in NET API, but I do not know what it can be for civil EC data.

With regards,

  Jan

  • Hi Jan,

    If I understood your requirement correctly, It seems it's not possible to get stationing information from Alignment in Microstation.

    You might get some information about Schema using DgnECManager.LocateSchemaInScope from DGNPlatformNet but no real Civil information is stored on the alignment object.

  • Hi Shashank,

    thanks for your answer.

    no real Civil information is stored on the alignment object.

    Yes, I know. In a meantime a did some more analysis, which leads to a similar question in MicroStation Programming forum.

    I understand that no civil information is stored on the alignment, but using relationship the data itself is stored somewhere else (often on type 66 element).

    Because the whole path from alignment object to the station data is quite short (I guess one or two relation definitions), and the schema exists in DGN file, I think I am able to identify the right type 66 element even in plain MicroStation.

    But:

    • From four XAttributes, I understand one only (56FF:0) that I think holds StationEntity class XML data.
    • On the same element, StationEntity_Presentation (with start stationing info I need ;-) is stored, but in MicroStation, it's opaque data structure, available XAttribute byte array only.
    • From the data size, I assume 56EC:0 handler is responsible for not data itself, but maybe 5716:1 stores the data itself?

    May be I am naive (and I am aware this low level data hacking is generally bad idea :-), but I assume when binary data is decompressed, EC XML data is received? But have no idea what algorithm is used generally for EC data persistence and whether the same approach is used by CivilSchema handler. From documentation it looks like e.g. Snappy is used when data is serialized to i-model / SQLite, but what in DGN (normal ZIP, something else)?

    You might get some information about Schema using DgnECManager.LocateSchemaInScope from DGNPlatformNet

    Yes, but when it's about CivilSchema, which is generated in temp folder, when OpenRail Designer is started (not delivered with the product itself) and special handler is used to store the data, it really works only in civil products.

    With regards,

      Jan