|
POST
|
Hi Matt, Maybe I don't totally know what your doing, but if you start off with the features already being selected I wouldn't think you would need to set the definition query of the layer to. Can't you just run the GP Tool on the selected features?? Perhaps using in_features.GetSelection() might get you where you want to go. I haven't done any coding use GP tools, so I could be totally wrong.
... View more
05-17-2019
08:35 AM
|
1
|
1
|
4140
|
|
POST
|
There's different ways to do this. If this is for a specific layer, you could try something like this... Get the selected features: //****Get all of the selected ObjectIDs from the VLS layer.
var vlsLayer = MapView.Active.Map.FindLayers("GISWRKS1.WORKS.VLS_Points").First() as BasicFeatureLayer;
var selection = vlsLayer.GetSelection();
IReadOnlyList<long> selectedOIDs = selection.GetObjectIDs(); //save the selected OBJECTIDs to a list. Then process them: foreach (var oid in selectedOIDs)
{
//do something
}
To check for the number of selected features: vlsLayer.SelectionCount
... View more
05-13-2019
05:57 AM
|
2
|
3
|
4140
|
|
POST
|
Hi Duncan, It took a while but I eventually figured out that I was just using the wrong NuGet package in VisualStudio. Removing references and then using a different reference to the 2016 Microsoft SharePoint references seemed to fix the issue. Thanks,
... View more
05-13-2019
05:41 AM
|
0
|
0
|
784
|
|
POST
|
Hi Sean Jones. Changing from using the GUID from the Config file to the ID worked. Thanks! I would have thought using the GUID would have been the proper choice.
... View more
05-10-2019
06:54 AM
|
0
|
0
|
1372
|
|
POST
|
Thanks Gintatuas, Sean Jones I've done some messing around and my code seems to work with other tools in the map (ie. {AB073B49-DE5E-11D1-AA80-00C04FA37860} which is the Zoom to Selection button), but with my custom tool this bit of code... UID uid = new UIDClass();
uid.Value = "{079952c5-83c1-49e8-bd1a-4440f623281f}";
ICommandItem cmdItem = cmdBars.Find(uid, false, false); cannot find the tool. That is for sure the GUID of the tool. Do you know if there is a setting in the Config.esriaddinx file that I might need to set to make it 'Public'??
... View more
05-09-2019
11:06 AM
|
0
|
2
|
1372
|
|
POST
|
Hi, I'm trying to run a custom tool from an Editor Extension I am building. I've done this before with out of the box ArcMap tools (ie. Zoom to Selection), but for some reason this code I am using will not work for a custom tool I have created. The tool GUID is {079952c5-83c1-49e8-bd1a-4440f623281f} and it is definitely in my map, but when I run the tool it can't seem to find it based on the GUID, so cmdItem is null and the line "cmdItem.Execute();" does not run. Any ideas what I am doing wrong?? if (inFeature.Fields.FindField("FACILITYID") != -1)
{
ICommandBars cmdBars = ArcMap.Application.Document.CommandBars;
UID uid = new UID();
uid.Value = "{079952c5-83c1-49e8-bd1a-4440f623281f}";
ICommandItem cmdItem = cmdBars.Find(uid, false, false);
if (cmdItem != null)
cmdItem.Execute();
}
... View more
05-08-2019
05:53 AM
|
0
|
4
|
1520
|
|
POST
|
Hi, So I've written an Editor Extension which has some code that runs when a feature is deleted. Everything works 100% as needed, but today I decided to add a few lines of code to track some information in a Share Point List when a feature gets deleted. As soon as I add that code, none of the code within my onDeleteFeature event fires. It's like it doesn't even exists. But....as soon as I comment out the code I added, everything works fine. Really weird. I don't know what the heck is going on. See below. The code below works, but as soon as I uncomment the commented out section, nothing works. i don't even get the message box to pop up. If I debug, nothing in this entire code block runs, but the delete still happens in ArcMap. Any ideas?? //When a feature is Deleted.
void Events_OnDeleteFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
{
try
{
if (obj is IFeature)
{
//Cast to an IFeature
IFeature inFeature = (IFeature)obj;
ITable inTable = obj.Table;
if (inTable is IVersionedObject)
{
IVersionedObject3 vObject = (IVersionedObject3)inTable;
//Check if the Features Table is Versioned. If not, then exit.
if (vObject.IsRegisteredAsVersioned)
{
//Look for the Maximo field and edit.
if (inFeature.Fields.FindField("MXCREATIONSTATE") != -1)
{
MessageBox.Show("DELETE");
//using (SPSite spSite = new SPSite("https://...."))
//{
// using (SPWeb spWeb = spSite.OpenWeb())
// {
// spWeb.AllowUnsafeUpdates = true;
// SPList list = spWeb.Lists["GIS_Deletes"];
// //Add an item
// SPListItem newItem = list.Items.Add();
// newItem["MXASSETNUM"] = inFeature.Fields.FindField("MXASSETNUM").ToString();
// newItem["MXSITEID"] = inFeature.Fields.FindField("MXSITEID").ToString();
// newItem.Update();
// spWeb.AllowUnsafeUpdates = false;
// }
//}
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error in OnDeleteFeature procedure.");
}
}
... View more
05-03-2019
06:52 AM
|
0
|
2
|
914
|
|
POST
|
As for me, most likely through the Attribute pane, but possible the Attribute Table. I don't remember using Calculate Field. I'm not sure how the others who see the same problem were editing.
... View more
05-01-2019
08:41 AM
|
0
|
0
|
2208
|
|
POST
|
Hi, Well we are currently on ArcMap 10.4.1 and have been for some time. As for ArcGIS Pro, I have been using it regularly and updating it as soon as an update is available. I'm not totally sure how far back the problems with the editing goes. I have noticed with features edited between January and March of 2019, but it may go back even further. So whatever vesions of ArcGIS Pro were available during that time, might have been the culprit. We just found this issue the other day. Another department that does some editing in using esri is seeing the same issue in their data, and only with the user who has been using ArcGIS Pro. It's a real PITA to fix, since ArcMap sees the data as the same. The only way you can fix the problem is to export the data to a FGDB (we are on SDE normally), and then query out the data with the bad fields.
... View more
05-01-2019
08:17 AM
|
0
|
4
|
2208
|
|
POST
|
Does anyone know if there are (or used to be) issues with ArcGIS Pro entering incorrect domain values when editing data? We are in a mixed environment with some users on ArcMap and some on ArcGIS Pro. We just discovered that a user who exclusively uses ArcGIS Pro is having issues when selecting values in a domain. Instead of entering the CODE into the field, ArcGIS Pro has been entering the DESCRIPTION. For example,in the domain these are the options: In ArcGIS Pro everything seems OK, but when you look at the data in ArcMap you can see that ArcGIS Pro is actually adding the 'Description' into the field and not the 'Code'. For example, it is entering in 'Municipal' instead of 'municipal'. In ArcMap, looking at the data through Query Builder you can see the problem it causes. The highlighted field are actually wrong values. Has anyone else seen this?? Further testing at the current version of ArcGIS Pro (2.3.2), seems to have the issue resolved, but I am just wondering what prior version of ArcGIS Pro were causing the problem.
... View more
05-01-2019
06:47 AM
|
0
|
7
|
2354
|
|
POST
|
Ah...yes. To much flipping between the two groups!! 🙂 Thanks!
... View more
04-29-2019
04:59 AM
|
0
|
0
|
844
|
|
POST
|
Hi, Just wondering how to get access to open tabs in the GUI, specifically tabs that are open for Attribute Tables. What Object/Namespace should I be looking at to access these and get their properties (ie. Map they belong to, Feature class they are showing data for, etc.) Thanks!
... View more
04-26-2019
07:11 AM
|
0
|
2
|
898
|
|
POST
|
Yeah, I've been messing with GetOriginalValue, but HasValueChanged seems to be the better option. I'll look into the ArcObjects stuff you suggested too. Thanks again!
... View more
04-25-2019
12:55 PM
|
0
|
0
|
2492
|
|
POST
|
Actually Sean Jones ...one more question for you. In either ArcObjects or Pro, is it possible to determine which field/fields have changed in the edited row? The RowChangedEventArgs event doesn't seem to get the specific.
... View more
04-25-2019
06:27 AM
|
0
|
2
|
2492
|
|
POST
|
Yeah, this is the first time I've created a new tool in ArcObjects in years. It's all so foggy and convoluted after working in ArcGIS Pro. Thanks for your help!
... View more
04-25-2019
06:16 AM
|
0
|
0
|
2492
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-29-2026 07:40 AM | |
| 1 | 10-17-2023 07:40 AM | |
| 1 | 04-14-2026 08:54 AM | |
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-13-2018 10:07 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-29-2026
09:43 AM
|