3 Replies Latest reply on Dec 18, 2014 2:36 PM by cblakeborough

    Accessing ArcFM Feeder Manager 2.0 Fields in C#

    Dane Hopkins

      Hi guys,

      I'm looking to locate the index for the Feeder Manager 2.0 fields and then convert it to string, similar to the block below. Obviously this doesn't work, but this is similar to what I'm looking for. Can anyone help me with this and what reference to use in Visual Studio?


      int fiFCTransPhases = fields.FindField("ELE.TransformerBank_2472.EnergizedPhases");

      string FCTransPhases = pFeature.get_Value(fiFCTransPhases).ToString();




        • Re: Accessing ArcFM Feeder Manager 2.0 Fields in C#
          Robert Krisher

          It depends on how you're accessing the data.  If you're dealing with a layer object, you should be able to use the field name as you've described it.  If you are dealing with a feature class, then the fields don't exist directly on the feature. Instead you'll need to use one of the developer's samples posted here on exchange that show you how to initialize the fm2 lookup capabilities within ArcFM.  Here's a link to some sampel code: Sample - Synchronize Feeder Information

          • Re: Accessing ArcFM Feeder Manager 2.0 Fields in C#



            Feeder Manager 2's fields can't be accessed traditionally but Schneider Electric has an API available to access the data. To supplement the other answer, the code below takes a feature variable called "feat" and grabs the energized phases into a variable called "phases". This is extrapolated from Schneider Electric's documentation on Feeder Manager 2 and some samples like the one mentioned already. If you are looking at getting the value from code, this should work.


            IConnectionProperties connectionProps = new ConnectionProperties(((IDataset)feat.Class).Workspace);
            FeatureKey featKey = new FeatureKey(feat.Class.ObjectClassID, feat.OID);
            FeederInfoProvider provider = new FeederInfoProvider(connectionProps);
            IFeederInfo<FeatureKey> feeder2Info = provider.GetFeederInfo(featKey);
            Phases phases = feeder2Info.EnergizedPhases;


            Here are the usings that are needed:

            using ESRI.ArcGIS.Geodatabase;
            using Miner.Geodatabase;
            using Miner.Geodatabase.FeederManager;
            using Miner.Geodatabase.Network;
            using Miner.NetworkModel.Electric;



            Be sure to check out the sample as well if you need more assistance. You should be able to use the API effectively in most contexts, but be aware of the way that Feeder Manager 2 updates its data if you're attempting to build this into any update logic.


            Edit: Here's the API documentation.