Define Custom Forms in Smart Electrical - Intergraph Smart Electrical - Help - Hexagon

Intergraph Smart Electrical Help

Language
English
Product
Intergraph Smart Electrical
Search by Category
Help
Smart Electrical Version
10

The following procedure explains how to define the available custom common properties form in Smart Electrical.

Smart Electrical provides two files that are located in the Program folder of your Smart Electrical installation. These two files are SPELCustomForms.xml and SPELCustomForms.xsd. Make sure that you do not move these files from this location and that you do not make any changes to the SPELCustomForms.xsd file.

To integrate your custom forms, edit the SPELCustomForms.xml file. If you want to keep the SPELCustomForms.xml file as an example, rename it or copy it to another location.

Here is an example of such an XML file:

<?xml version="1.0" encoding="UTF-8"?>

<ItemTypes  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="nnm SPELCustomForms.xsd">

                <ItemType Name="Motor" DefaultProgId = "CustomForm.MotorForm">

                       <Forms>

                             <Form Name = "Some Form Name" Description = "Some Form description />

                        </Forms>

                </ItemType>

                <ItemType Name="Generator" DefaultProgId = "CustomForm.CustomEdit">

                        <Forms>

                               <Form Name = "Some form name1" ProgId ="CustomForm.CustomEdit" Description = "Power Cables" />

                               <Form Name = "Some Form name2" ProgId ="CustomForm.CustomEdit" Description = "Instr. Cables" />

                        </Forms>

                </ItemType>

</ItemTypes>

When editing the SPELCustomForms.xml file, remember the following:

  • For each item type, there has to be an <ItemType> node that points to the appropriate Visual Studio Class Library and module class according to the following syntax:

    <ItemType Name="Motor" DefaultProgId = "[Class Library Project Name].[Module Class Name]">

    For example:

    <ItemType Name="Motor" DefaultProgId = "CustomForm.CustomEdit">

    If a form that you created belongs to a project different from the one indicated in the DefaultProgId node, add a new line in the <Forms> node that points to the required project.

  • Under the <ItemType> node, there has to be a <Forms> node under which you add all the forms that you want to have for this item type.

  • Each <Form Name> node must have a name definition and it can have a ProgId and description definitions. Use the following syntax:

    <Form Name = "[Form Name]" ProgId ="[Class Library Project Name].[Module Class Name]" Description = "[Text]" />

    Note the following:

    • There must be a name definition for each form. This name will appear on the Select Common Properties dialog, in the Common Properties Form field.

    • You can define a ProgId different from the default ProgId or you can omit this definition if you like. If there is no ProgId for a particular form, the default ProgId will be in use.

    • The Description definition that you type here will appear on the Select Common Properties dialog, in the Description field. You can omit the Definition description if you like.

  • If you want to add another form for a different item type, define an additional <ItemType Name> node for that form.

  • If want to share your custom forms with another user, copy the DLL file that was created by Visual Studio and the SPELCustomForms.xml file to the Smart Electrical installation folder of the user who will share your custom forms. There is no need to copy the SPELCustomForms.xsd file as it is provided with every installation.

    Remember that you must register the DLL file once it is copied to another computer.