[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
  • There are functions available to access the GridSystem, but they seem to not be included in the c# wrappers

    While you're waiting for the OBD developers to extend their API, you'll have to write your own P/Invoke wrappers for the functions you want.

    It isn't hard to write a wrapper, provided you known the data types of the parameters.  Sometimes it's not so easy to translate between C-style data types and .NET.  Here's an example from the ProjectWise programming people (MostOfDavesClasses.cs)...

    [DllImport("dmscli.dll", CharSet = CharSet.Unicode)]
    public static extern bool aaApi_SelectDatasourceStatistics();
    

    That C# file is full of useful examples, definitions, and idioms that help get you from C to C#.

    Unfortunately, I think OBD API is the worst and most fragmented API from power platform products APIs, where the most of functionality is available only in (very) old C API

    The ProjectWise APIs are similarly antiquated.  That's why I found MostOfDavesClasses.cs extremely useful when programming with C# for PW Explorer.

     
    Regards, Jon Summers
    LA Solutions

Children
No Data