Customize Cable Sizing Formulas - Intergraph Smart Electrical - Help - Hexagon

Intergraph Smart Electrical Help

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

  • To customize the formulas, you must have a basic knowledge of C# programming.

  • Installation of .NET Framework 4.7.2 is a prerequisite for creating custom formulas.

Smart Electrical comes with built-in formulas for cable sizing. You can define your own custom formulas for cable sizing which will override the default formulas. You can also use this functionality to translate into another language the titles and descriptions that appear on the Sizing Report tab of the Cable Common Properties dialog box. Custom formulas are applied per plant. You can use the same custom formula in multiple plants by copying the same set of project files to the special Customization folder you will need to create under each plant folder.

The example shown in this procedure applies to the Derating Factor calculation. To help you implement the customization, you can download the Cable Sizing Sample Code. The available interfaces for implementing custom sizing calculations are as follows:

  • ICableSizingCalculator: Full cable sizing logic

  • IAmbientTemperatureFactorCalculator: Ambient Temperature Factor

  • IDeratingFactorCalculator: Derating Factor

  • IUtilizationFactorCalculator: Utilization Factor

  • IFullLoadCurrentCalculator: Full Load Current

  • IPhaseFactorCalculator: Phase Factor

  • ICableLengthCalculator: Cable Length

  • IVoltageDropCalculator: Voltage Drop

  • ICustomValidator: Custom validation after cable sizing calculation

  1. In Microsoft Visual Studio, create a new project of type Class Library.

  2. Type a name for the project.

    SHARED Tip We recommend that you choose a name that corresponds to the interface for the sizing calculation you want to customize, for example: TestDeratingCalculator.

    If appropriate for your version of Visual Studio, choose 4.7.2 as the .NET Framework version.

  3. Reference the namespaces 'Ingr.SEL.CableSizing' and 'Ingr.SEL.CableSizing.Calculators' from Ingr.SEL.CableSizing.dll, which is located in the Smart Electrical application's \bin folder.

    If Smart Electrical is installed on a different machine from the one on which Visual Studio is installed, ensure that you have at least read permission to the application's \bin folder.

  4. Create a new class 'CustomDeratingFactorCalculator' and implement the 'IDeratingFactorCalculator' interface.

    This class returns the result of the calculation and enables you to add titles and comments that will be shown on the Sizing Report tab. For an example of this class and interface, see Code example for Derating Factor calculation.

    SHARED Tip You can use the titles and comments for translating the content of the report for the specified calculation as well as for updating the property descriptions.

  5. Navigate to the folder of each plant where you want to customize the formulas and create a new folder named 'Customization' under the plant folder, for example: \\WinSrv2019db\SmartPlant\CompanySite\Plants\CompanyPlant\Customization.

  6. Build the project and place the resulting assembly inside the 'Customization' folder of each plant for which you want the customized formulas to be implemented.

    When building the project, choose x86 as your target platform.

  7. To map the new type with the default type, do the following:

  1. Create an .xml file for assembly mappings named CableSizingConfig.xml and place it inside the same 'Customization' folder with the assembly.

  2. Create a <configuration> section and register the new type with the existing type that you intend to override, for example:

    <configuration>

    <register type='Ingr.SEL.CableSizing.Calculators.IDeratingFactorCalculator' mapTo='TestDeratingCalculator;CustomDeratingFactorCalculator'></register>

    </configuration>

    SHARED Tip To map more than one assembly, add a new <register type> ... <register type> line for each assembly.

  3. When using ICustomValidator, do the following:

    <register type='Ingr.SEL.CableSizing.CustomValidation.ICustomValidator' mapTo='TestCableSizingCustomValidators;TestValidator'/>

  1. Test the custom calculation in Smart Electrical.

    The following example shows report results before and after customization.

  • BEFORE:

  • AFTER: