Hello,
I am creating an add-in for our editors that will allow them to automatically move customer service lines that are connected to an existing water main, to a new water main that is nearby. A simple example of this is shown in the following picture, where the horizontal blue line on the bottom is the existing water main with a connected service line (made up of 4 features: a "ferrule" point feature that lies on the water main, which connects to a water service line feature, which connects to a "curb stop" point feature, which finally connects to another water service line feature). The red arrow shows how I am trying to move the ferrule point feature, and extend the first water service line feature, to the new water main on top.
The issue I am running into is that, even though the edit operation applying the new geometries is successful, no geometry edits are actually made to the two features. I believe this might be related to our utility network junction-edge connectivity rule for ferrule point features to water service line features. This is because I tried my add-in on an old geometric network copy of our water network, and the geometries update correctly.
I imagine that since I have to update the geometries of the two features (in different layers) in two separate steps, that the first edit step isn't considered valid because it temporarily doesn't satisfy the connectivity rule until the second edit step is also made? I would have thought that doing both of these edits in the same edit operation would take care of this, but apparently not? Is there a way to temporarily disable the connectivity rule, execute my edit operation, and then re-enable the rule? Or is it likely a different problem?
Also, it's worth mentioning that I need to keep all the feature object id's the same, so I can't just delete these features and create new ones.
Below is a rough example of my code:
// not shown, my program previously calculates the new geometry for these that
// would place the service line off the new water main instead of it's current location
Geometry newFerruleGeometry = ...
Geometry newServiceLineGeometry = ...
var inspectors = new List<Inspector>();
// first load the existing ferrule feature into an inspector, and set its new geometry
var inspectorFerrule = new Inspector();
inspectorFerrule.Load(FittingLayerParentTable, existingFerrule.ObjectId);
inspectorFerrule.Shape = newFerruleGeometry;
inspectors.Add(inspectorFerrule);
// then load the existing service line feature into an inspector, and set its new geometry
var inspectorServiceLine = new Inspector();
inspectorServiceLine.Load(WaterServiceLinePipesLayerParentTable, existingServiceLine.ObjectId);
inspectorServiceLine.Shape = newServiceLineGeometry;
inspectors.Add(inspectorServiceLine);
var editOperation = new EditOperation
{
Name = $"Transfer X service lines"
};
foreach (var inspector in inspectors)
{
editOperation.Modify(inspector);
}
if (!editOperation.IsEmpty)
{
var opSuccess = editOperation.Execute();
if (!opSuccess)
{
Debug.WriteLine($"Error executing edit operation: {editOperation.ErrorMessage}");
}
else
{
Debug.WriteLine("Transfer service lines operation completed successfully.");
}
}
Thanks