[CONNECT C#] Grid created by Grid Manager

Hi,

I am trying to access the grid properties (grid lines, coordinates, orientation, etc.) of a OpenBuildings Designer model from a c# addin. I can see from the XML export that the used EC schema should be StructuralModelingComponents.06.00.

When I ask the DgnECManager for discover-able schemas, it doesn´t include that schema though.

List<string> schemas = Enumerable.ToList(manager.DiscoverSchemas(Session.Instance.GetActiveDgnFile(), ReferencedModelScopeOption.All, true));

I also tried

FindInstancesScope scope = FindInstancesScope.CreateScope(Session.Instance.GetActiveDgnFile(), new FindInstancesScopeOption(DgnECHostType.All, true));
IECSchema schema = manager.LocateSchemaInScope(scope, "StructuralModelingComponents", 6, 0, SchemaMatchType.Latest);


but with no success. 

The IntegratedStructuralModel schema wouldn´t work either.

Are grid lines somehow not part of the model or should I look in a different schema? 

Might there be a different way to access grids? 

See also https://www.itwinjs.org/bis/domains/processphysical.ecschema/#ismcartesiangrid for reference.

Parents Reply
  • it is not always visible in the view.

    Ok, I found it (with some search in documentation, because my OBD knowledge is limited): Floor Manager has to be set to specific level, so the grid defined for this level is displayed.

    I was also wondering, if it might be not part of the design file.

    It is written in documentation that grid is transient snapable object ... which tells everything (if the terminology is the same as in API).

    But where would it come from then?

    Evey application can create so called transient elements: They are very similar to normal elements (they belong to levels, are displayed in views etc.), but they are not stored anywhere and are hold in memory only.

    And it might be not a traditional building object (also can´t be selected)?

    It seems to me more like visual aid than building object.

    I am trying to access the grid properties

    Let's assume the grid is implemented using transient elements. In such case, it is not accessible using standard MicroStation API, because transient elements do not exist in DGN file.

    Theoretically there are two options, both using native (C/C++) API:

    • There are some old C functions available in MicroStation API to create and access transient elements, but it gives you access to elements only.
    • I assume there are also Floor manager functions available in OBD API, allowing to access information about grid parameters.

    Regards,

      Jan

Children