Hi
Can anyone please show/explain me the way I can create EC Schema for microstation connect using C#?
Regards
Hi Michal,
there are two options:
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
At the moment all exemplary schemas I've come across were in xml. Is this they way how to create them?
Jan Šlegr said:To use NET API to create schema directly by code.
I would preferer to use c# for creation but don't know how? Have you got any example of how to create EC Schema in c#?
Michal Ziolko said:At the moment all exemplary schemas I've come across were in xml. Is this they way how to create them?
No, it depends on context:
I have used both way, depending on a project requirements.
Michal Ziolko said:I would preferer to use c# for creation but don't know how?
I am not aware of any official example or tutorial. But API is quite straightforward.
Michal Ziolko said:Have you got any example of how to create EC Schema in c#?
No. The code I wrote is for (commercial) trainings or for projects I did for different customers.
Regards,
Is there anything which you can tell me to point me to the right direction?
Michal Ziolko said:Is there anything which you can tell me to point me to the right direction?
It's curious: ECSchemas are a core part of MicroStation, but they are poorly-documented. In fact, the best documentation is in the Schema Editor that Jan mentioned. The MicroStationAPI help manual is full of EcXxx classes that deal with schemas, but has little to say about how to use them.
You may find solace in the Bentley iTwin pages. Here, for example. Keep in mind that Jan is the only ECSchema expert outside Bentley Systems. And, given their reluctance to help, or even comment, he may be the only ECSchema expert anywhere, inside or outside Bentley Systems.
Regards, Jon Summers LA Solutions
Hi Michal Ziolko,
Consider taking a look at a compilation of Getting Started with EC resources that may help. It provides many convenience links to EC Documentation, Training and "Class Editor" options available.
Also consider downloading and overlaying the SDK Help resources to help correct the "missing EC SDK documentation" mentioned since it provides a single convenient help file (SDKHelp.chm) to make searching across all common API/SDK CHM documentation easier.
Lastly, MSCE SDK U17.1 when available (approx. 6 months) should correct the missing EC documentation and include the (now separate) SDKHelp.chm help project.
HTH,Bob
In my opinion it depends a lot on your current knowledge of EC schemas. API is a tool only, it does not help you in any way when you do not know how EC schema works and how it is structured.
To be able to design a schema with a pencil on paper should be your target. If you did not yet, design EC schema (just a few classes) using Class Editor. Also, check how existing schemas are done: You can try some from schemas delivered with MicroStation (but they are really complex) or to create Item Type library, export the schema(s) and open it in the editor.
As I wrote, I think API is not complicated, even when to create and work with arrays maybe not intuitive for the first sight. But I do not expect you decide to design EC classes with (nested) arrays and extensive use of attributes.
Even when partially target BIS and not current EC schema generation, the link provided by Bob is useful for sure.
Thanks. So in essence it seems that if I want to use it I have to learn it myself.
Michal Ziolko said:If I want to use it I have to learn it myself
Yes: not many people are MicroStation developers using .NET or C++. Of those, very few have attempted to develop an ECSchema.
Bentley Systems created ECSchemas to help unify BIM across their vertical applications. Once an app. development team implements an ECSchema for their product, and that product attaches instances of their schema to DGN elements, then all kinds of things become possible, such as creating reports of BIM data and exporting to iModels.
The principle focus of ECSchema is on internal use. There's no incentive for Bentley Systems to evangelize ECSchemas. I take my hat off to Jan for persevering over many years to understand and implement ECSchema technology.
Jon Summers said:The principle focus of ECSchema is on internal use. There's no incentive for Bentley Systems to evangelize ECSchemas.
On the other hand, they do it with iTwin.js open-source project, where BIS is the data standard. And BIS is nothing else than "EC next" ;-)
Plenty of EC objects, that exist in BIS, were migrated from EC with no or very few changes, some are new, but quite often exists also in EC, but in another form. So to understand overall concepts of EC (ECObjects2), BIS description (ECObjects3) can be used.