I am trying to use this tool which can be found in the ArcToolBox under data management, geometric network
I need to access this tool using ArcObjects because I have loaded features into their respective feature classes, and I would like to run an exauhstive check on their geometric network status using the extent.
I came across IGeometricNetworkConnectivity2
, and I can use it on each feature class separately, but it does not allow me to do an exhaustive search or use an extent for that matter, it will run on the entire .
Here a sample of where I am at now
var ftrClass =LoadFeatureClass(shapeFileObject)
var netWorkGeo = ftrClass as INetworkClass;
var nWCheck=(IGeometricNetworkConnectivity2)netWorkGeo.GeometricNetwork
string logger= string.Empty;
ISet set = new Set();
bool consistincy;
nWCheck.CheckAndRepairConnectivity(true, logger, out set,out consistincy,repairConnectivityProg);
I tried using the IGeoProcessor Interface to run the tool, but I am getting an exception eventhough I am passing correct parameters according to the ArcToolBox Help provided. The exception is raised on Execute.
try {
var array = new VarArrayClass();
var gp = new GeoProcessorClass();
gp.AddToolbox(@"c:\program files (x86)\arcgis\desktop10.2\ArcToolbox\Toolboxes\Data Management Tools.tbx");
array.Add("ElectCoilNet");
array.Add(@"c:\OutLog.txt");
array.Add("VERIFY_ONLY");
var result = gp.Execute("VerifyAndRepairGeometricNetworkConnectivity_management", array, null);
} catch (Exception ex) { Logger.LogException(ex);}