How To Add a Base Class to a Class in Bentley Class Editor CONNECT Edition


Applies To 
Product(s):Bentley Class Editor CONNECT Edition
Version(s):10.xx.xx.xxx
Environment: Windows 10/11 (64 bit)
Area: Schemas
Subarea: Classes
Original Author:Álvaro Melgarejo, Bentley Global Technical Support

Background

When adding new custom classes to the OpenPlant schemas, the same class might be needed on both OpenPlant.01.08.ecschema.xml, hereinafter referred to as OpenPlant Schema, and OpenPlant_3D.01.08.ecschema.xml, hereinafter referred to as OpenPlant3D Schema. In such cases, the user should keep in mind that all the classes that are common to both schemas have their origin in the OpenPlant Schema. Hence, the classes in the OpenPlant3D Schema are Derived from the existing classes with the same name in the OpenPlant Schema. The opposite of a Derived class is a Base class.

In this context, but not limited to it, the user might need to add a Base class to a class. Below, the step-by-step on how to accomplish this in the context described above.

Steps to Accomplish

  1. Open Bentley Class Editor CONNECT Edition.
  2. Open the OpenPlant Schema and the OpenPlant 3D Schema and supplement them as appropriate.
  3. On the OpenPlant Schema, select the desired location for creating a custom class. For this example, the following location has been chosen:
    OpenPlant -> Classes -> Plant Base Object -> Named Items -> Plant Breakdown Element

    Right click on Plant Breakdown Element and select Add Derived Class. A new class will be created under the selected location; rename it as desired. In this example it will be renamed as CUSTOM. Note: now Plant Breakdown Element is a Base class of CUSTOM, but this is not yet the end goal of this document.
  4. On the OpenPlant 3D Schema, navigate to the analogous location and create a class with the exact same name, following the same process.
  5. Right click on the latter, and click on Base Classes…
  6. On the window that pops up, on the Filter field, type the name of the newly created class and hit Apply.
  7. On the center box, the class with the same name belonging to the OpenPlant Schema will show up. Double click on it and hit OK.

Now, the custom class created in the OpenPlant 3D Schema is a Derived class of the class with the same name in the OpenPlant Schema. This means that it inherits all its properties, plus it can have some more of its own.

All the attributes that are added to the Base class in the OpenPlant Schema will be automatically passed down to the Derived class in the OpenPlant 3D schema.