|
POST
|
OK. Sounds good. I will ZIP up a bunch of data and the source code. How do I send it to Tech Support?? Can you give me their contact info?? I'm out of the office tomorrow, but I'll try to get it out to you on Wednesday. Thanks,
... View more
10-29-2018
10:03 AM
|
0
|
2
|
1142
|
|
POST
|
Hi Rich, I'm trying to edit using EditOperation, but having some issues getting the code to work. Can you see where I am going wrong? No errors, but the feature doesn't actually get edited. foreach (var oid in selectedOIDs)
{
var qf = new QueryFilter() { WhereClause = "OBJECTID = " + oid };
var cursor = currentLayer.Search(qf);
var editOp = new EditOperation { Name = "Edit DEPOTAREA" };
while (cursor.MoveNext())
{
Row row = cursor.Current;
editOp.Modify(row, "DEPOTAREA", "ORONO");
featureCount++;
}
editOp.Execute();
}
... View more
10-29-2018
08:49 AM
|
0
|
11
|
1142
|
|
POST
|
Hi Rich, Yes, the other fields have mangled names too, but only with the join present. All the fields are from the same table/feature. I will give it a go with Editor.Modify() and get back to you. Thanks!
... View more
10-25-2018
12:11 PM
|
0
|
12
|
1142
|
|
POST
|
Hi, Using the .GetFieldDesciptions I can see that the name without the join is "DEPOTAREA" and with the join it is "GISWRKS1.WORKS.SAN_Manhole.DEPOTAREA". But....the three lines of code before the DEPOTAREA assignment are working properly, so I'm confused as to why the DEPOTAREA field is not working. GRIDNO, LocalMunicipality and SettlementArea are not causing me any problems. In ArcObjects I would use this line of code to do basically the same thing, and never ran into problems related to Joins: feature.set_Value(feature.Fields.FindField("DEPOTAREA"), UpdateByLandFeature(feature, depotAreaFLayer, "DEPOTAREA")); Is there a recommended way for editing fields that I am not doing right?? I never know when a user may/may not have a join and I would like this to work for all instances, just like in ArcMap. Thanks!
... View more
10-25-2018
10:05 AM
|
0
|
15
|
2625
|
|
POST
|
Hi Rich Ruh. Sorry for the delay getting back to you, but I am back in the office now. I've done some more testing, but I am still getting the same error even when hard-coding the value in as you describe above....but ONLY when I have a join on that layer. Without a join, the same code works fine. Is there anything else you think I should test??
... View more
10-25-2018
06:58 AM
|
0
|
17
|
2625
|
|
POST
|
Hi RRuh-esristaff and UHarano-esristaff Thanks! That definitely helps. Now that I have gotten past that, there is another line of code that is getting an exception, but again, only when a Join is present. Here is a screen shot....hopefully you can help with this too: Basically, the GetIntersectingField returns a string value to populate the DEPOTAREA field. It only crashes when a Join is present. Again, I'm not really sure why. By stepping through the code the proper values are getting returned. Manually I can do the same edit to the DEPOTAREA field through the Attributes pane without any problems. Here is the code for the GetIntersectingField, but it seems to be working fine. The DEPOTAREA field is associated with a domain if that makes any difference, but the code works fine with no Join present. //This does a SpatialQuery using the current feature point and a layer to get the intersecting field value
public string GetIntersectingField(MapPoint point, string fieldName, FeatureLayer sourceLayer)
{
try
{
SpatialQueryFilter spatialFilter = new SpatialQueryFilter();
spatialFilter.FilterGeometry = point;
spatialFilter.SpatialRelationship = SpatialRelationship.Intersects;
spatialFilter.SubFields = fieldName;
string fieldValue = "";
int i = 0;
RowCursor gridCursor = sourceLayer.Search(spatialFilter);
Feature feature;
while (gridCursor.MoveNext())
{
using (feature = (Feature)gridCursor.Current)
{
int fieldPosition = feature.FindField(fieldName);
fieldValue = feature[fieldPosition].ToString();
i++;
}
}
//if CONTRACTNO and more than one intersecting boundary, then show a message box and populate field with nothing
if ((fieldName == "CONTRACTNO") && (i > 1))
{
fieldValue = null;
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("There is more than one intersecting Contract Boundary for ??. Please enter this field in manually.", "Contract Number");
}
return fieldValue;
}
catch (Exception ex)
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(ex.ToString());
return null;
}
}
... View more
10-17-2018
05:59 AM
|
0
|
0
|
2625
|
|
POST
|
OK, so with both in the same FGDB I can get past that bit of code. Is there anything you can suggest I look for within my original setup to get things to work?? In ArcMap, I have similar code which works on the same SDE feature class and table combination.
... View more
10-16-2018
09:40 AM
|
0
|
2
|
2625
|
|
POST
|
Hi Uma, No, nothing fancy. My feature layer is in SDE, and the table is in the project file GDB. I will try exporting the feature layer to the file GDB and report back. Thanks,
... View more
10-16-2018
09:05 AM
|
0
|
0
|
2625
|
|
POST
|
Hi, I'm using the following code to determine if a field exists in the current layer: var currentLayer = map.FindLayers(layer.Name).FirstOrDefault() as BasicFeatureLayer;
//Does current layer have FACILITYID field??
Boolean facID_field = false;
TableDefinition tableDef = currentLayer.GetTable().GetDefinition();
if (tableDef.FindField("FACILITYID") >= 0)
facID_field = true; When I do not have a Join setup on the layer everything is fine, but with a Join I will get an "InvalidOperationException" error on the TableDefinition line of code: An exception of type 'System.InvalidOperationException' occurred in ArcGIS.Core.dll but was not handled in user code Additional information: The dataset 'SAN_Manhole_MH_dbf' does not have a valid definition. In this case, the layername is 'SAN_Manhole' and the joined table is 'MH_dbf'. Is there another way I should be looking for fields in a layer?? Or is there just an issue with Joined layers going on in the background. Thanks,
... View more
10-15-2018
08:21 AM
|
1
|
25
|
5080
|
|
POST
|
So the problem was that the desktop did not have the latest updates. I created the tool under 2.2, but they only had 2.1. After updating, all is fine.
... View more
09-14-2018
11:02 AM
|
0
|
0
|
937
|
|
POST
|
Hi, I'm testing an add-in I've created for the Backstage. On my development machine it works fine, but on another users desktop it does not work. When I click on 'Options' and then click on my custom tab, I just get an error (see image below). Any ideas why this might be happening?? On my development machine, this is what it looks like:
... View more
09-14-2018
08:45 AM
|
0
|
1
|
968
|
|
POST
|
Hi, I am having this same problem also. Restarting the application is not making a difference. I am trying to delete many fields in a FGDB. Doesn't seem to matter if the FGDB was created in ArcMap or ArcPro, I have the same issue with either. I am trying to delete many fields, but even if I just select a few, I get the same problem. See image below: It seems like it deletes one or two fields, and then stops. Afterwards the FGDB is not accessible and all my data is lost, even after a restart of ArcPro. I have tried creating the feature class from scratch, by importing from another GDB (both PGDB and FGDB), and also by importing from a shapefile. All cases eventually lead to me getting the above error when trying to delete fields.
... View more
08-17-2018
11:21 AM
|
0
|
0
|
13972
|
|
POST
|
I think the name difference is probably due to me renaming my server connection after I create it. Yes, I'll keep you posted if I run into troubles again.
... View more
08-17-2018
11:16 AM
|
0
|
0
|
2777
|
|
POST
|
Hi Eric, Yes, it is a Geocode Service that (I think) we host on an internal server. Here is the path if you want to try and get to it yourself: Locators/ADDR_Durham_Pro (GeocodeServer) Anyways, what I have done is to remove the current Locator as well as the server. I then re-added the server (from above), added the Locator and now it seems to work. I'm not sure what has happened to my original connection to the server, but I suppose something has become messed up. I keep it in my 'Favorites' and just add it from there whenever I need it. Perhaps something has gone wrong with there somehow?? Thanks,
... View more
08-17-2018
07:55 AM
|
0
|
2
|
2777
|
|
POST
|
Hi. I am still having this problem. Using the same process, same table of addresses and same geocoder works in ArcMap but not in ArcPro.
... View more
08-14-2018
06:46 AM
|
0
|
4
|
2777
|
| 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
|