Sample - Work Function Calculator

Version 3

    Versions: 10.0.1 - current

    Product Availability: ArcFM Desktop (Designer license required)


    The Work Function Tool in Designer allows a user to select an existing feature and replace it with a different compatible unit (CU). The default algorithm that determines the GIS unit (GU) work function looks for a CU with an install work function and a CU with any other work function. You may use IMMWorkFunctionCalculator to create a custom algorithm to customize the criteria for assigning the Replace work function. The work function calculator developer sample sets the GU work function to Replace if it contains one Install CU and at least one Remove CU.

    How to Implement:

    1. You may modify the code sample. This step is not required.
    2. Build the solution sample.
    3. Create a Registry key called Work Function at the following location in the Registry (if it doesn't already exist):
      • 32-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Miner and Miner\Designer8\
      • 64-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Miner and Miner\Designer8\
    4. Right-click the Work Function key and create a String Value called Calculator Object.
    5. Right-click the Calculator Object String Value and select Modify.
    6. Enter the progID of the .cs you wish to use in the Value Data field. The progID is [Project Name].[Class Name]. For example: SampleWorkFuncCalculator.UnitOnlyCUs.

    How to Use:

    There are various ways to see this tool in action. The following steps are just one scenario.

    1. In ArcMap, start an edit session (or open a design).
    2. Select the CUs tab and set the Work Function field to Install.
    3. Send a CU to the Targets tab (e.g., Transformer). This results in a GU under which resides a CU.
    4. Select the GU (top level node) and note that its Work Function is set to Install.
    5. Now, set the Work Function field on the CUs tab to Remove.
    6. Drag a similar CU (e.g., another Transformer) and drop it onto the GU you just added. This results in two CUs under the GU.
    7. Select the GU and note that its work function is now Replace.




    All of the files shown below are required for the solution to build successfully.


    SampleWorkFuncCalculator.csprojC# project containing the code to generate a custom work function calculator.
    UnitOnlyCUs.csThis class module provides an example of a custom work function calculator object.