|
POST
|
Hi Narelle Chedzey, The data is in SDE. Standard features classes...nothing too fancy going on here. No relationships or networks. There are some topology rules on the data, but my tool only edits attributes, not geometry. I'm still experiencing the intermittent editing issues when running the tool. But then if I try again a few seconds later it works fine. Generally we don't give out data without a data licence agreement, but if there are some specific things you want me to try, just let me know.
... View more
08-07-2018
10:34 AM
|
0
|
0
|
1251
|
|
POST
|
Hi, I'm trying to use a locator service with the 'Geocode Addresses' geoprocessing tool. When I select the locator I get the following error message: If I use the same locator using the 'Locate' pane, it works....no errors. But with the Geocode Addresses tool it doesn't. It used to work all the time, and does work for other people in the office. It seems to be intermittent, but we are not sure why. I am at the latest version of ArcPro (2.2.1) as are others who have it working.
... View more
08-07-2018
08:04 AM
|
0
|
5
|
3204
|
|
POST
|
Hi Narelle Chedzey. Thanks for the tip on using the 'Using' statement. I have now included that in my code, as well as modifying the editOperation.Execute as follows: if (editOperation.Execute() == true)
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(updatedFeatures.ToString() + " features updated.", "Fittings Tool - Update Complete");
else
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(editOperation.ErrorMessage.ToString(), "Fittings Tool - ERROR");
Unfortunately, I am still occasionally getting the error come up. Are there any other ways to narrow down what might be happening?? After getting the error I just click on the button to fire the code again, and it works successfully. Generally this happens when I am running the tool in Debug mode the first time I try to run it.
... View more
07-25-2018
10:12 AM
|
0
|
1
|
1251
|
|
POST
|
Also, here are some screen shots of the problem. In the first one the MessageBox tells me that the code ran because the updatedFeatures counter has increased to 2 (2 selected features), but the edits didn't take because the Diameter is still at 300mm (default) and the WATERMAINID has not changed from default. In the second screenshot everything has worked fine. The MessageBox says the same thing (2 updated features), but you can actually see where the Diameter and WATERMAINID have been updated correctly. Also, the 'edit' shows up in the Undo button (not shown). In both cases the EditOperation.Execute must have been executed, since the MessageBox is the next line of code. I'm just not sure why it isn't actually doing anything. What I also notice is that when it does work the Attributes pane kind of flickers, but when it doesn't work nothing happens in the Attribute pane. In those cases I also try hitting the 'Refresh' button on the map pane, but it makes no difference.
... View more
07-25-2018
06:20 AM
|
0
|
0
|
1251
|
|
POST
|
Hi, I have a button with some code behind it that edits the attributes of selected features when run. I am having an intermittent issue where sometimes the code runs and works properly, and other times it runs and only seems to partially complete. I don't get any error messages in either case, and in each case my code gets all the way to the end and displays a MessageBox with the results. But, when it doesn't work I can see that the attributes on the selected features have not been updated and the process is also not available to 'roll-back' via the undo button (ie. not on the undo-stack). I have posted the code below, but was just wondering if anyone else has seen this issue. When I notice that the code hasn't worked, I just hit the button again (without changing anything related to my selection in the map) and then it all works fine. I just don't know why it won't work that first time. Also, this is intermittent. Sometimes it works the first time, sometimes it doesn't. I cannot find any pattern. protected async override void OnClick()
{
try
{
int updatedFeatures = 0;
await QueuedTask.Run(() =>
{
//Start the edit operation, and place on the UNDO stack
var editOperation = new ArcGIS.Desktop.Editing.EditOperation();
editOperation.Name = "Update Fittings Diameters on Selected Features";
editOperation.EditOperationType = ArcGIS.Desktop.Editing.EditOperationType.Long;
Map map = MapView.Active.Map;
FeatureLayer waterMainLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WaterMain").FirstOrDefault();
FeatureLayer waterServiceLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WaterService").FirstOrDefault();
FeatureLayer hydrantLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WAT_Hydrant").FirstOrDefault();
FeatureLayer controlValveLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WAT_ControlValve").FirstOrDefault();
FeatureLayer waterFittingsLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WAT_Fitting").FirstOrDefault();
FeatureLayer reliefValveLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WAT_ReliefValve").FirstOrDefault();
FeatureLayer pressureZoneLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "GISWRKS1.WORKS.WAT_PressureZone").FirstOrDefault();
#region Check for Relief Valves
//Check for the Relief valves layer to be in the map
if (reliefValveLayer != null)
{
//Check to see if there is a selection
if (reliefValveLayer.SelectionCount > 0)
{
//Get the OIDs of any selected Relief Valves
var reliefValvesSelection = reliefValveLayer.GetSelection();
IReadOnlyList<long> selectedOIDs = reliefValvesSelection.GetObjectIDs();
//Create an Inspector to edit the selected features
var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector();
//Loop through each selected OID
foreach (var oid in selectedOIDs)
{
//Load the current Relief Valve into the inspector
insp.Load(reliefValveLayer, oid);
//Get the coordinate of the current Relief Valve
MapPoint reliefValvePoint = (MapPoint)insp.Shape;
//Could be intersecting a WaterService or a WaterMain.
//Do for WaterServices first:
SpatialQueryFilter wsFilter = new SpatialQueryFilter();
wsFilter.FilterGeometry = reliefValvePoint;
wsFilter.SpatialRelationship = SpatialRelationship.Intersects;
wsFilter.SubFields = "*";
//Loop through each intersecting WaterService using a RowCursor.
RowCursor wsCursor = waterServiceLayer.Search(wsFilter);
Feature wsFeature;
//Go to the first item in the cursor, and use it as a Feature
wsCursor.MoveNext();
wsFeature = (Feature)wsCursor.Current;
if (wsFeature != null)
{
insp["Diameter"] = wsFeature["Diameter"];
insp["WATERMAINID"] = wsFeature["FACILITYID"];
//Update these attributes on the Relief Valve from the WaterService, if required
if (Properties.Settings.Default.fitContractNumberSetting == true)
insp["CONTRACTNO"] = wsFeature["CONTRACTNO"];
if (Properties.Settings.Default.fitInstallDateSetting == true)
insp["INSTALLDATE"] = wsFeature["INSTALLDATE"];
if (Properties.Settings.Default.fitDataSourceSetting == true)
insp["DATASOURCE"] = wsFeature["DATASOURCE"];
if (Properties.Settings.Default.fitLifecycleSetting == true)
insp["LifecycleStatus"] = wsFeature["LifecycleStatus"];
}
//end of if wsFeature loop
//Add code for WM here ****
editOperation.Modify(insp);
updatedFeatures++;
}
//end of foreach Relief Valve loop
}
//end of if selected Relief Valve > 0 loop
}
//end of if Relief Valve layer != null loop
#endregion
editOperation.Execute();
});
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(updatedFeatures.ToString() + " features updated.", "Fittings Tool - Complete");
}
catch
{
}
finally
{
}
}
... View more
07-25-2018
05:55 AM
|
0
|
5
|
1420
|
|
POST
|
Yes, I have exactly the same question. I think I've been able to calculate the MAX value of a certain field, but I have no idea of how to actually get the value out of the TableStatisticsResult. Any help is appreciated. FeatureClass vlsFC = vlsLayer.GetFeatureClass();
FeatureClassDefinition fcd = vlsFC.GetDefinition();
Field fldVLS_NO_1 = fcd.GetFields().First(x => x.Name.Equals("VLS_NO_1"));
StatisticsDescription vlsMaxDesc = new StatisticsDescription(fldVLS_NO_1, new List<StatisticsFunction>() { StatisticsFunction.Max });
TableStatisticsDescription tsd = new TableStatisticsDescription(new List<StatisticsDescription>() { vlsMaxDesc });
IReadOnlyList<TableStatisticsResult> vlsStatsResult = vlsFC.CalculateStatistics(tsd);
//This does not work
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Max VLS is " + vlsStatsResult.Max);
... View more
07-23-2018
10:04 AM
|
0
|
2
|
3247
|
|
POST
|
Hmmmm.....after closing the project and opening it up again, now all is fine. Scrolling left/right or up/down is working as expected. Strange. The scroll bar is now a 'normal' size too. Must be something going on, but I have no idea what would have happened. If it does happen again, I will post again.
... View more
07-12-2018
10:34 AM
|
1
|
0
|
1050
|
|
POST
|
Version 2.2. The data is coming from our SDE server (SQL).
... View more
07-12-2018
10:29 AM
|
0
|
1
|
1050
|
|
POST
|
Hi, The 'pane' that shows subtypes does not seem to be scrolling properly. See the images below. For this particular feature class, there are about 10 subtypes, but I can only view 4 in the pane. Here is the pane when scrolled to the left: Here is the panewhen scrolled to the right; the data in the pane is not panning with the scrollbar. Or am I doing something wrong?? Also when scrolling up/down the Field Names at the left side do not scroll with the subtypes on the right. It's hard to explain, but it seems like all the columns scroll in pairs, independent of all the other columns.
... View more
07-12-2018
09:58 AM
|
0
|
5
|
1121
|
|
POST
|
Hi Uma, Unfortunately I was getting so annoyed I ended up just creating a new project from scratch and copy/pasting all the code from the old one to the new one. Within about 10 minutes I had everything working again, without really changing anything. So, I'm not really sure if that helps to troubleshoot why it stopped working. Has something changed with how a 'Property Sheet' project works in 2.2?? All of my other projects are working fine after the 2.2 update. It was just this one that was giving me troubles. If this happens again I will investigate the tools you mention above before recreating a project.
... View more
06-29-2018
12:10 PM
|
0
|
1
|
1038
|
|
POST
|
Here is the Property Sheet section in my config.daml <propertySheets>
<updateSheet refID="esri_core_optionsPropertySheet">
<insertPage id="esri_sdk_PropertyPageAppSettings" caption="DSM Tool Settings" className="ApplicationSettingsViewModel" group="Application">
<content className="ApplicationSettingsView" />
</insertPage>
</updateSheet>
</propertySheets>
... View more
06-29-2018
10:34 AM
|
0
|
3
|
1038
|
|
POST
|
Hi, I just updated to 2.2 and now the custom property page that used to appear under Options - Application is no longer visible. I have recompiled and still no luck. Any ideas as to what I can try to get things working again??
... View more
06-29-2018
10:29 AM
|
0
|
4
|
1086
|
|
POST
|
Hi, Thanks for responding. I can't seem to get your method to work, but alternatively what I am doing is just building all of my tools in the same project as my 'Property Sheet'. Not the most ideal solution, but the easiest way to get around the problem. All I need to do now is access Properties.Settings.Default.<the setting> to access the value.
... View more
06-27-2018
11:52 AM
|
0
|
1
|
935
|
|
POST
|
Hi Shana Britt. No, uploading directly into SDE isn't an option as most of us (ie. end users) do not have Admin rights to the database. Alternatively, I have been messing with this today and here are some things I am finding (using ArcPro 2.1.3): 1. I can no longer add an .XLS table to ArcPro 2. If I convert the .XLS to a .dbf I can add that to ArcPro and join to the layer, but the layer still will NOT add as a Locate Provider. 3. If I import the .dbf from above into the projects PGDB (in the Home folder), I can join it to the layer, but the layer still will NOT add as a Locate Provider For all of the above, the feature class I am using is in SDE.
... View more
06-27-2018
06:48 AM
|
0
|
1
|
1195
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-19-2018 05:53 AM | |
| 1 | 04-13-2018 10:07 AM | |
| 1 | 04-13-2018 10:04 AM | |
| 1 | 04-13-2018 05:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-20-2025
03:53 PM
|