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);
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.
Hi Tilman,
please respect and follow this forum best practices: Specify exactly what product and version (build number) do you use. The only information you shared so far is that you are on CONNECT Edition platform and you have design file, created in OpenBuilding (I guess OpenBuilding Designer?). But does it mean you use MicroStation to read the file? Or you have OBD (or some other OpenBuilding product)?
Tilman Reinhardt said:of a OpenBuildings model
Can you share a small example of the file?
Tilman Reinhardt said:Might there be a different way to access grids?
You did not share the whole code and also you did not share any DGN example. I do not know a structure of OBD models in detail, but I assume grid lines etc. are standard MicroStation elements with EC data attached? In your code I do not see anything, that access these elements.
Tilman Reinhardt said:Are grid lines somehow not part of the model or should I look in a different schema?
What exactly do you want to achieve?
Tilman Reinhardt said:See also https://www.itwinjs.org/bis/domains/processphysical.ecschema/#ismcartesiangrid for reference.
Not at all! What you referenced is BIS (Base Infrastructure Schema), not EC schema used in PowerPlatform CE. BIS is the successor of EC, but it is not the same.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
sorry, I also accidentally sent the post without a proper subject. (edit: found the edit button)
So I created a very simple file with AECOsim Building Designer Connect Edition Update 4 - Version 10.04.00.69
see /cfs-file/__key/communityserver-discussions-components-files/343173/grid.dgn
To read the file I use Building Designer as well.
As far as I understand, this is a feature specific to this product. Microstation (and OpenRail or OpenRoads) only allow a simple, regular grid (see screenshot). I am not looking for that (it´s stored in the ModelInfo btw).
This is why I would assume that those grids are not part of the standard EC schema (but that´s just me guessing). When I try to export the grid to .xml I get the following output, which made me assume that the model would come with a StructuralModelingComponents.06.00 schema, which I can´t access/find.
<?xml version="1.0" encoding="utf-16"?><ECInstanceXML> <IsmCartesianGrid instanceID=":56FF00000001:15A1A70000" xmlns="StructuralModelingComponents.06.00"> <Id>0f779f2e-6908-49d0-88d2-e1d5c3e50cc8</Id> <Name>BuildingGrid</Name> <RAxis> <Coordinate xmlns="">www.bentley.com/.../Bentley.Geometry.Common.1.0"> <xyz>1,0,0</xyz> </Coordinate> </RAxis> <SAxis> <Coordinate xmlns="">www.bentley.com/.../Bentley.Geometry.Common.1.0"> <xyz>0,1,0</xyz> </Coordinate> </SAxis> <Origin> <Coordinate xmlns="">www.bentley.com/.../Bentley.Geometry.Common.1.0"> <xyz>0,0,0</xyz> </Coordinate> </Origin> </IsmCartesianGrid> ... </ECInstanceXML>
My thought was to use the ECManager to access the IsmCartesianGrid:
FindInstancesScope scope = FindInstancesScope.CreateScope(Session.Instance.GetActiveDgnFile(), new FindInstancesScopeOption(DgnECHostType.All, true)); IECSchema schema = manager.LocateSchemaInScope(scope, "StructuralModelingComponents_IsmCartesianGrid", 6, 0, SchemaMatchType.Latest); IECClass[] classes = ItemInstanceCollector.ItemInstanceCollector.GetSearchClasses(schema); ECQuery query = new ECQuery(classes); DgnECInstanceCollection instances = manager.FindInstances(scope, query);
I am looking for the grid line geometry (start and end points of the lines in respect to the global coordinate system).
Thanks for pointing out the difference to the BIS.
Best,Tilman
Tilman Reinhardt said:So I created a very simple file with AECOsim Building Designer Connect Edition Update 4 - Version 10.04.00.69
Isn't it a bit old? I know it is not topic of this discussion, but I recommend to upgrade to the latest Update 8. Even when for some reason building team is not able to release new version when PowerPlatform is updated, so Update 8 is based on CE U15 platform, whereas the current is U16.1, but U15 is still much faster and stable than U11 that I guess was used for OBD CE U4.
Tilman Reinhardt said:This is why I would assume that those grids are not part of the standard EC schema (but that´s just me guessing).
I think there is a misunderstanding what EC data is and how it is used in MicroStation (but maybe the problem is only in formulation).
EC data can be attached to an element (like ItemTypes, which are a functional subset of EC data, using pre-defined EC schema), or (nearly) any element can be represented as EC data (when proper EC schema is available). But, elements are not store as EC data, so to access them as EC classes is (usually) possible, but does not makes sense, because it is just overkill.
Tilman Reinhardt said:I am looking for the grid line geometry (start and end points of the lines in respect to the global coordinate system).
Why you not access the grid line geometry using standard location and geometry API? E.g. to enumerate model to search the grid elements and to obtain its geometry using proper query?
Regards,
Is really the grid placed in the attached design file? I see one simple line with not any data attached. And in OBD (using Neutral metric dataset) it is not recognized as any building object.
Tilman Reinhardt said:As far as I understand, this is a feature specific to this product
Do you mean Grid created by Grid Manager? Why not to share this information from the beginning?
Tilman Reinhardt said:sorry, I also accidentally sent the post without a proper subject.
I think, as author, you can edit subject anytime.