|
IDEA
|
When editing branch versions users occasionally encounter version locks by other users. There doesn't seem to be a way for non-administrator users to view the locks since they are only accessing the service. If this is already available please let me know the steps. Currently a user has to report version locks to the administrator who then connects to the geodatabase to see who is locking a specific version. Then the administrator has to coordinate with the other user to see if they can release the lock. It would be better if the two non-admin users can see the locks and communicate with each coordinate getting the lock released.
... View more
01-26-2022
10:58 AM
|
3
|
0
|
498
|
|
POST
|
In case someone (future me perhaps) comes across this post I'm posting my latest code. //Used the snippet to get utility network
var un = GetUtilityNetwork();
foreach (var item in ss)
{
var featureLayer = item.Key as BasicFeatureLayer;
if (featureLayer.Name.Contains("ASSEMBLY"))
{
EditOperation editOp = new EditOperation();
var qf = new QueryFilter() { ObjectIDs = item.Value };
RowCursor sr = featureLayer.Search(qf);
while (sr.MoveNext())
{
Row tempfeat = sr.Current;
try
{
var ele = un.CreateElement(tempfeat);
var assocs = un.GetAssociations(ele);
foreach (var a in assocs)
{
AssociationDescription associationToDelete = new AssociationDescription(a.Type, new RowHandle(a.FromElement, un), new RowHandle(a.ToElement, un));
editOp.Delete(associationToDelete);
}
editOp.Delete(tempfeat);
}
catch (Exception ex)
{
//log.Error(ex, $"Oid {tempfeat.GetObjectID()}");
}
}
var t = editOp.Execute();
var editOpChain = editOp.CreateChainedOperation();
if (t)
{
editOpChain.Delete(ss);
t = editOpChain.Execute();
}
}
}
... View more
01-20-2022
05:36 PM
|
0
|
0
|
3362
|
|
POST
|
Good information Rich. For additional context we have decided that the assemblies we originally created in the migration process are not providing value and are making editing more difficult. The code I'm working on will allow us to "clean up" these assemblies we no longer want and do some other house keeping that I didn't include in my pseudo code.
... View more
01-20-2022
05:33 PM
|
1
|
0
|
3362
|
|
POST
|
Thanks for the quick response @RichRuh, you got me over that hump. I would not have thought to use CreateElement, I was looking for something like GetElement. But I'm still missing something on how to delete the associations. When I use UtilityNetwork.DeleteAssociation I get an exception (The current operation requires an edit operation). I also see that EditOperation.Delete has an overload for an AssociationDescription but I don't see to instantiate that object from an Association or Element. //Used the snippet to get utility network
var un = GetUtilityNetwork();
foreach (var item in ss)
{
var featureLayer = item.Key as BasicFeatureLayer;
if (featureLayer.Name.Contains("ASSEMBLY"))
{
EditOperation editOp = new EditOperation();
var qf = new QueryFilter() { ObjectIDs = item.Value };
RowCursor sr = featureLayer.Search(qf);
while (sr.MoveNext())
{
Row tempfeat = sr.Current;
try
{
var ele = un.CreateElement(tempfeat);
var assocs = un.GetAssociations(ele);
foreach (var a in assocs)
{
un.DeleteAssociation(a);
/*
ArcGIS.Core.Data.GeodatabaseGeneralException: The current operation requires an edit operation.
---> System.Runtime.InteropServices.COMException: TabletPC inking error code. Initialization failure (Exception from HRESULT: 0x80040223)
at ArcGIS.Core.Internal.IUtilityNetworkIOP.UtilityNetwork_DeleteContainmentAssociation(IntPtr utilityNetworkHandle, Int32 containerSourceID, Guid containerGlobalID, Int32 contentSourceID, String[] contentGlobalIDs)
at ArcGIS.Core.Data.UtilityNetwork.UtilityNetwork.DeleteAssociation(Association association)
--- End of inner exception stack trace ---
at ArcGIS.Core.Data.UtilityNetwork.UtilityNetwork.DeleteAssociation(Association association)
at MyTools.Button1.<OnClick>b__1_0()
*/
}
editOp.Delete(tempfeat);
}
catch (Exception ex)
{
//log.Error(ex, $"Oid {tempfeat.GetObjectID()}");
}
}
var t = editOp.Execute();
}
}
... View more
01-20-2022
03:23 PM
|
0
|
0
|
3384
|
|
POST
|
I'm trying to delete the selected features in a map some of which are Utility Network Assemblies with Associations. When I execute my edit operation this error message is returned " The feature participates in a utility network and has existing association records that must be removed prior to deleting the feature." Which seems simple enough, I need to delete the associations before trying to delete the assembly. Unfortunately I have no idea how to do that. I've looked at the sdk documentation and samples, I'm not seeing away to access associations starting from an oid and map member. I hope I'm missing something obvious. I would appreciate any ideas? var ss = MapView.Active.Map.GetSelection();
EditOperation editOp = new EditOperation();
foreach (var item in ss)
{
foreach (var oiditem in item.Value)
{
//How to get/delete associations for this oid?
editOp.Delete(item.Key, oiditem);
}
}
editOp.Execute()
... View more
01-20-2022
10:10 AM
|
0
|
6
|
3424
|
|
POST
|
While performing steps 1 (edits features) and 2 (validate network) above in a version eventually an error will occur that prevents the user from saving edits. So far I have been unable to consistently reproduce the behavior. This leading me to believe that validating in a version is not a good idea. @MelissaJarman any insights?
... View more
01-10-2022
05:10 PM
|
0
|
1
|
3290
|
|
POST
|
There is definitely some odd behavior with the way the ArcGIS Pro coreHost behaves inside the AutoCAD. I've tried a variety methods to keep the ArcGIS SDK code in it's own thread but it hasn't worked. I'm probably going to have to design the code to write to the AutoCAD database without the UI. For now users are working around the problem to closing and restarting AutoCAD after each command that accesses the ArcGIS SDK corehost.
... View more
12-13-2021
02:48 PM
|
0
|
0
|
1741
|
|
POST
|
I'm now seeing the same behavior using ArcGIS Pro 2.8.3 and connecting to Utility Network branched versioned services from ArcGIS enterprise 10.9.
... View more
12-13-2021
02:20 PM
|
0
|
0
|
1157
|
|
POST
|
In ArcGIS Pro 2.8.3 when trying to update a feature using Python update cursor an error occurs (see below). This error occurs in our enterprise implementation of the Water Utility Network Solution and also when using the sample Naperville data provided in a file geodatabase. Editing workflows in the ArcGIS Pro UI work fine for this type of edit. These attribute rules were provided as part of the Water Utility Network Solution. If I disable the attribute rule it will fail on another rule (Water Line - MeasuredLength From Shape), when both are disabled the edit occurs without error. Here is a simplified snippet of code: import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps()[0]
idFeature = []
for lyr in m.listLayers():
lyrdesc = arcpy.Describe(lyr)
if lyr.isFeatureLayer:
fi = lyrdesc.fieldInfo
obj = lyrdesc.FIDSet
if obj:
wc = "OBJECTID in ({0})".format(obj.replace(";",","))
print(wc)
with arcpy.da.UpdateCursor(lyr, ["OID@", "NOTES"],wc) as cursor:
for row in cursor:
row[1] = "TEST"
cursor.updateRow(row) RuntimeError: Failed to evaluate Arcade expression. [ Rule name: Water Line - Cathodic Protection Traceability, Triggering event: Update, Class name: WaterLine, GlobalID: , Arcade error: Field not found cptraceability, Script line: 25]
... View more
12-13-2021
01:47 PM
|
0
|
4
|
2093
|
|
POST
|
Are there any best practices for running validate Network Topology against a branched version Utility Network? In a version other than sde.Default I make data changes and get dirty areas. Click the Validate Network Topology Current Extent button. Dirty areas are gone. Save Reconcile and Post Switch to sde.Default The dirty area is now in sde.Default Click the Validate Network Topology Current Extent button. Dirty areas are really gone. Based on those steps there is always a need to run Validate Network Topology against sde.Default even after clearing dirty areas in another version. Is this the proper workflow?
... View more
12-09-2021
02:39 PM
|
0
|
7
|
3378
|
|
POST
|
Yes I am aware of those methods but I need to modify the features. Those methods don't provide the same granular access to rows. To clarify I need to set an organization id on the feature then use that ID to write to an external data repository.
... View more
11-23-2021
02:37 PM
|
0
|
0
|
899
|
|
POST
|
I have a need to detect when a split occurs so that I can get a new custom ID and update a database that is outside ArcGIS. This code works fine when using an Enterprise geodatabase. However when I execute a split against a utility network branch version layer the events never fire but the split operation completes successfully. Using fiddler I was able to see that the applyEdits is sending a "splits" object as opposed to "updates" or "creates". private Dictionary<string, List<SubscriptionToken>> _rowevents = new Dictionary<string, List<SubscriptionToken>>();
foreach (var fl in ActiveMapView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>())
{
var fc = fl.GetFeatureClass();
var tokens = new List<SubscriptionToken>();
tokens.Add(RowCreatedEvent.Subscribe((rc) => RowEventHandler(rc), fc));
tokens.Add(RowChangedEvent.Subscribe((rc) => RowEventHandler(rc), fc));
tokens.Add(RowDeletedEvent.Subscribe((rc) => RowEventHandler(rc), fc));
_rowevents[fc.GetName()] = tokens;
}
private void RowEventHandler(RowChangedEventArgs rc)
{
//Never fires when a split
}
... View more
11-23-2021
09:46 AM
|
1
|
3
|
1115
|
|
POST
|
Because FeatureSetByRelationshipName returns a FeatureSet that may have more than one row. You can't just return it you have to get a value from a row. Assuming you have a one to one relationship you can just get the First one: if (!IsEmpty(test))
{
return First(test).COMMENT_
} If you have one to many, you would have to apply more logic to decide which one you want.
... View more
10-11-2021
02:57 PM
|
0
|
0
|
994
|
|
POST
|
Yes the process appears to complete each time. I think you're on to something with the Dispose/Using. I put the versionmanager into a using block and that helps. There's still some issues but I suspect there are some other objects that are not in a using or disposed of. Hopefully once I get them being disposed it will just work.
... View more
09-22-2021
05:11 PM
|
0
|
0
|
2253
|
|
POST
|
I tried IsSignedOn and it does not return false it actually throws the following exception: ArcGIS.Core.SystemCore.SystemCoreException: 'Error HRESULT E_FAIL has been returned from a call to a COM component.'
... View more
09-22-2021
03:17 PM
|
0
|
0
|
2255
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-07-2023 04:56 PM | |
| 1 | 03-19-2025 03:48 PM | |
| 11 | 03-19-2025 04:45 PM | |
| 2 | 09-17-2024 10:47 AM | |
| 5 | 02-08-2024 09:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|