MicroStation CONNECT: EC Schemas & Class Editor

  • Products
  • Services
  • All Publications
  • CONNECT Publications
  • Links
  • WishList
  • LA Solutions
  • Home
LA Solutions
tel: +44 1398 361 800

Introduction

This article provides a brief overview of EC Schema technology in MicroStation CONNECT.

EC Schemas

EC Schemas were introduced with MicroStation V8i and their use is enlarged in MicroStation CONNECT. EC Schemas are meta data that define data types, analogous to a relational database schema. EC Schemas are not graphic elements; rather, they represent a MicroStation capability for storing structured alpha-numeric data. Bentley Systems terminology for data stored in Item Types include 'business data' and 'EC Schema data'.

EC Schemas are the foundation of Item Types.

  • EC Schemas define data, not graphics
  • An EC Schema defines application-specific business data
  • A graphic element is often associated with EC Schema data
    • MicroStation does not provide tools to enable a user to make that association
    • The association is created by an application based on MicroStation (e.g. AECOSim)
  • Reports, as provided by MicroStation CONNECT, do not work with EC Schema data

The MicroStation ECX command lets you export a schema, or other information.

Q To define an Item Type Library implicitly defines an EC Schema?

Yes.

Q Is the schema that it defines a first-class schema, equivalent to a schema defined any other way?

Yes, to workflows which operate on EC Schemas, Item Type Libraries look like any other EC Schema. e.g., Reporting, Explorer, etc.

Q That is, do we lose any capability by creating an Item Type Library?

You lose some capabilities and gain others.

An Item Type Library supports a subset of the features supported by hand-rolled EC Schemas, for two reasons:

  1. We wanted to simplify some EC concepts so the average user can comprehend and use them (if you have used Class Editor, you have some inkling of how complicated EC Schemas can become).
  2. We needed to simplify things in order to design a usable user interface around editing schemas (I do not consider Class Editor a user-friendly interface).

At the time of writing with respect to MicroStation CONNECT Update 6, some EC features are not supported by Item Types …

  • Class inheritance
  • Nested structs
  • ECRelationship classes
  • Calculated properties (very much desired though)
  • Read-only properties
  • Non-standard schema references (i.e. each Item Type Library is self-contained)

Some capabilities are only available for Item Types …

  • Attach/Detach Item tool
  • Ability to create/edit within MicroStation
  • Ability to import from dgnlibs
  • Integration with parametric modeling via Variables dialog

Neither of the above is a comprehensive list.

Q To define an Item Type Library implicitly defines an EC Schema?

It can be discovered easily:
  1. Create a new empty file.
  2. Use ecx schema list key-in to list all schemas stored in the file.
  3. Create your Item Type definition and save it to the file.
  4. Use the key-in again to check how the number of stored schemas changed.
  5. You will see some standard (supplement) schemas area added and also DgnCustomItemTypes_<name>.01.00 schema is created.

For further research you can export the schema and open it in Bentley Class Editor.

Export ECSchema

There a number of MicroStation key-in commands that enable export of an ECSchema or a sub-set of a schema …

ECX SCHEMA EXPORT schema-name
ECX SCHEMA IMPORT schema-name  ! Use with caution !
ECX SCHEMA LIST
ECX SCHEMA UPDATE

ECX ITEMS COUNT
ECX ITEMS DUMP
Export Schemas Dialog

Those ECX commands have some options …

[help|?]
Display help message
[output_filepath_with_no_spaces]
The full path and name of the file to which the XML dump is written. There can be no spaces in the path or file name. If this is not supplied, the dump is generated to the user's TEMP folder with a unique name derived from the Active Design File Name.
[Verbosity=Full|Minimal]
Optional parameter that controls the level of information. The default is Full, which will dump fully serialized instance data. Minimal will only output IDs and class names.
[InstanceType=All|Intrinsic|Extrinsic]
Optional parameter that controls what types of instances are dumped. The default is All. Extrinsic refers to business data stored on elements/models, e.g. ECXA instances. Intrinsic refers to instances representing intrinsic properties of elements/models/files, e.g. the geometry of a line element.

Class Editor

About the time that MicroStation CONNECT Update 5 was released, Bentley Systems announced the first CONNECT ECSchema Editor 1.0. The title editor belies the fact that is a read-only viewing tool. Perhaps later versions will enable editing.

None the less, it provides a useful way to view the structure of a schema. Moreover, its help documentation provides a valuable insight into the raison d'être of ECSchemas and their use in products from Bentley Systems.

Bentley Systems developer Paul Connelly commented about Class Editor V8 …

Don't edit an Item Type Library schema in Class Editor V8!

Veteran independent MicroStation developer Jan Slegr commented …

I am not sure if there is "Bentley Class Editor CONNECT Edition" available. Checking my computer with CONNECT Edition SDK installed I can found Class Editor 8.1, which I guess was installed together with Navigator or V8i SDK (not sure ;-)

It would be nice if Class Editor will be enhanced. If I need to create some schema (which is not very often), I am quite happy with the current version, but:

  • From time to time it crashes or starts work in a strange way. Restart the app is quick but annoying.
  • Very limited documentation about e.g. available Property Attributes ro more advanced concepts like relationship classes etc. This is not primarily Editor issue, but it limits its usage.

Jan further added My personal list …

  • Based on stable powerfull EC Framework technology. Maybe it's an "internal thing", but EC data is common and used by many Bentley products and it's stored as XAttributes, so it's fully supported and compatible with DGN V8, i-model and Bentley world in general. Not as tags, that were implemented "on top of DGN V7" with many limitations
  • Fully compatible with i-Model, so nothing is lost when exported e.g. to Navigator and used on Android or iPad (including ability to search
  • Can be attached not to elements only, but also to design while, to particular model and also to references and attached rasters
  • Easy to search in Explorer for Item Types including standard table display format (including ability to export the results to CSV or Excel)
  • Possibility to create (and store) complex queries
  • Item Types can be used as an input to other tools (reports, charts etc)
  • Standard storage format allows to access data easily by other applications

Contributors

I am indebted to Bentley Systems staff member Paul Connelly and to Be Communities MVP Jan Slegr. Both have contributed both factual information about Item Types and EC Schemas as well as their interpretation of how they can be used. They contribute enthusiastically to the MicroStation Programming Forum.



Bentley Technology Partner

Trademarks

All trademarks are acknowledged. Trademarks may be registered in some jurisdictions.

Contact LA Solutions using this enquiry form.


Home
Updated on 03-Jan-2021 Copyright © 2021…2025 Jon Summers