Sample - Attribute Autoupdaters

Version 1

    Versions: 9.3.1 - 10.1

    Product Availability: ArcFM Desktop

     

    The autoupdaters in this developer sample use the IMMAttrAUStrategy interface. Each .cls file below represents a separate attribute autoupdater.

     

    How to Implement:

    1. You may modify the code sample. This step is not required.
    2. Compile the code sample and copy the DLL into ArcFM Solution\bin.
    3. In the ArcFM Solution\bin directory, drag the dll and drop it onto RegX.exe to register it.

     

    This project contains the following autoupdaters. Some require the configurations shown.

     

    Sample ArcFM Login User Name

    • Assign the AU to a field with a data type of Text and no domain assigned.

     

    Sample Auto Angle Setter

    • Assign the AU to a field with a data type of Double on a point feature (e.g., SymbolRotation).
    • Before placing the feature, you must open ArcMap and enable Symbol Rotation on the layer to which you assigned the autoupdater. Select the Display tab in the Table of Contents. Right-click the feature layer and select Properties. Select the Symbology tab, click the Advanced button, and select Rotation. In the "Rotate Points by Angle in this field" pulldown menu, select the field to which you assigned the Simple Auto Angle Setter autoupdater. Click OK on all dialog boxes.

     

    Sample Auto Phase Assign

    • PhaseDesignation field: assign PhaseDesignation field model name and the PhaseDesignation domain.
    • Assign the AU to the PhaseDesignation field (data type of Double) on a feature class (e.g., Service Point) that snaps to features with the CONDUCTOR model name assigned.

     

    Auto Phase Assign Autoupdater

    • PhaseDesignation field: assign PhaseDesignation field model name and the PhaseDesignation domain.
    • Assign the AU to the PhaseDesignation field on a feature class (e.g., Service Point).
    • This AU compares the Phase Designation values of a feature and its connected feature. If the Phase Designation values do not match, the AU presents a dialog that asks the user to choose the phase to assign to the new feature.

     

    Sample Calculate Trace Weight

    • NormalPosition_A field: assign NormalPosition_A field model name and a domain in which Closed=1 and Open=0.
    • NormalPosition_B field: assign NormalPosition_B field model name and a domain in which Closed=1 and Open=0.
    • NormalPosition_C field: assign NormalPosition_C field model name and a domain in which Closed=1 and Open=0.
    • PresentPosition_A field: assign PresentPosition_A field model name and a domain in which Closed=1 and Open=0.
    • PresentPosition_B field: assign PresentPosition_B field model name and a domain in which Closed=1 and Open=0.
    • PresentPosition_C field: assign PresentPosition_C field model name and a domain in which Closed=1 and Open=0.
    • Assign the AU to a field with a data type of Long Integer and no domain assigned.

     

    Sample Current Date

    • Assign the AU to a field with a data type of Date and no domain assigned.

     

    Sample Set Electric Enabled

    • NormalPosition_A field: assign NormalPosition_A field model name and a domain in which Closed=1 and Open=0.
    • NormalPosition_B field: assign NormalPosition_B field model name and a domain in which Closed=1 and Open=0.
    • NormalPosition_C field: assign NormalPosition_C field model name and a domain in which Closed=1 and Open=0.
    • Assign the AU to a field (e.g., Enabled) with a data type of Short Integer and a domain in which False=0 and True=1.

     

    Sample Set Gas Enabled

    • NormalPosition field: assign NormalPosition field model name and a domain in which Closed=1 and Open=0.
    • Assign the AU to a field (e.g., Enabled) with a data type of Short Integer and a domain in which False=0 and True=1.

     

    Sample Gas Valve Auto Size

    • Assign the PIPE model name to the pipe feature class (e.g., DistributionMain, Service) to which the valve will snap.
    • On the pipe feature class, assign the PIPEDIAMETER field model name to the field that holds the diameter of the pipe and has a data type of Text.
    • On the gas valve feature class, assign the Gas Valve Diameter domain to the field that holds the diameter of the valve. This domain has a field type of Text and contains coded values for the various valve diameters. This domain must be given the name "Gas Valve Diameter" for the AU to appear in the field menu.
    • Assign the AU to the Diameter field on the Valve feature class.

     

    Sample Length Double

    • The field to which the AU is assigned must have a data type of Double and no domain assigned unless it is the Measured Length domain.
    • Assign the AU to the MeasuredLength field, On Feature Create property of a linear feature.

     

    Sample Length Measured Domain

    • The Measured Length domain must be assigned to the field to which the AU is assigned.
    • Assign the AU to the MeasuredLength field, On Feature Create property of a linear feature.

     

    Sample Length Single

    • The field to which the AU is assigned must have a data type of Single (Float) and no domain assigned unless it is the Measured Length domain.
    • Assign the AU to the MeasuredLength field, On Feature Create property of a linear feature.

     

    Sample Length Integer

    • The field to which the AU is assigned must have a data type of Long Integer and no domain assigned unless it is the Measured Length domain.
    • Assign the AU to the MeasuredLength field, On Feature Create property of a linear feature.

     

    Sample Sewer Auto Valve Size

    • Assign the PIPE model name to the pipe feature class (e.g., DistributionMain, Service) to which the valve will snap.
    • On the pipe feature class, assign the PIPEDIAMETER field model name to the field that holds the diameter of the pipe and has a data type of Text.
    • On the sewer valve feature class, assign the DomainFMsValveSize domain to the field that holds the diameter of the valve. This domain has a field type of Text and contains coded values for the various valve diameters. This domain must be given the name "DomainFMsValveSize" for the AU to appear in the field menu.
    • Assign the AU to the Diameter field on the Valve feature class.

     

    Sample User Name

    • Assign the AU to a field with a data type of Text and no domain assigned.

     

    Sample Water Auto Valve Size

    • Assign the PIPE model name to the pipe feature class (e.g, DistributionMain, Service) to which the valve will snap.
    • On the pipe feature class, assign the PIPEDIAMETER field model name to the field that holds the diameter of the pipe and has a data type of Text.
    • On the valve feature class, assign the DomainFMwSize domain to the field that holds the diameter of the valve. This domain has a field type of Text and contains coded values for the various valve diameters. This domain must be given the name "DomainFMwSize" for the AU to appear in the field menu.
    • Assign the AU to the Diameter field on the Valve feature class.

     

    Requires:

    All of the files shown below are required for the project to compile successfully.

     

    FileDescription
    Miner.Samples.AttrAUStrategy.csprojC# project containing the code to generate a custom attribute autoupdater
    ArcFMLoginUserAU.csThe Sample ArcFM Login User Name AU extracts the ArcFM login name for the user currently logged in and returns that resulting string.
    AutoAngleSetter.csThe Sample Auto Angle Setter AU automatically rotates a point feature by the same angle of linear feature to which it is snapped. This autoupdater works only when placing networked features.
    AutoPhaseAssg.csThe Sample Auto Phase Assign AU returns a phase designation for a point feature when placed within a search tolerance of a conductor.
    AutoPhaseAssignAU.csThis AU compares the Phase Designation values of a feature and its connected feature. If the Phase Designation values do not match, the AU presents a dialog that asks the user to choose the phase to assign to the new feature.
    AutoTraceWeight.csThe Sample Calculate Trace Weight AU calculates and displays a trace weight value based on the Normal Position and Present Position field values.
    DateAUStrategy.csThe Sample Current Date AU queries the system for a date and returns the value.
    ElecSetEnabled.csSets the enabled/disabled field to False if any of the normal positions are open. Likewise, it sets the enabled property to True if any of the positions are closed (and none are open).
    GasSetEnabled.csSets the enabled/disabled field to False if the Normal Position is Closed.
    GasValveSize.csThe ArcFM Gas Valve Auto Size AU updates the diameter of a valve to match the diameter of the main to which it is snapped.
    LengthAUDouble.csThe ArcFM Length Double AU updates the Measured Length field with the value in the Shape_Length field. Enters the length value as double.
    LengthAUMeasured.csThe ArcFM Length Measured Domain AU updates the Measured Length field with the value in the Shape_Length field. Uses a value from the Length Measured domain.
    LengthAUSingle.csThe ArcFM Length Single AU updates the Measured Length field with the value in the Shape_Length field. Enters the length value as single.
    LengthStrategy.csThe ArcFM Length Integer AU updates the Measured Length field with the value in the Shape_Length field. Enters the length value as integer.
    SewerValveSize.csThe ArcFM Sewer Valve Size AU updates the diameter of a valve to match the diameter of the main to which it is snapped.
    UserAUStrategy.csThe ArcFM User Name AU returns the Windows user name.
    WaterValveSize.csThe ArcFM Water Valve Auto Size AU updates the diameter of a valve to match the diameter of the main to which it is snapped.
    AssemblyInfo.csSupporting class module.
    AutoupdaterUtilities.csContains functions common to autoupdate strategies.
    MMStartup.csModule for initialization of Schneider Electric applications and error logging, shared by all C# projects.
    MMValveSize.csModule for common function for the valve size autoupdaters.
    Phase.csProvides the values for the Phase enumeration (used by AutoPhaseAssignAU.cs).