|
POST
|
This sample does what you need (in 2D and 3D): Map-Exploration - Identify With SketchTool If you look at CustomIdentify.cs you will see the code snippet you are looking for. Let me know if that works for you, Wolf
... View more
03-18-2019
02:00 PM
|
0
|
5
|
1859
|
|
POST
|
Sorry Thomas, There is no easy way to convert to a Datatable object. I personally like to use the Datatable because of its capabilities and wide support by user controls, hence i used a DataTable in the sample i referenced above. You can also look at the new TableControl with a ProGuide here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-TableControl and the corresponding sample here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/TableControl.
... View more
02-22-2019
04:49 PM
|
1
|
0
|
4017
|
|
POST
|
Hi Thomas, You can look at this sample here https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/IdentifyWindow I think this does pretty much what you need, except you need to get all features instead of just the selected features. You also have to add your own 'column' filter logic in the GetSelectedFeaturesAsync method. Hope this helps, Wolf
... View more
02-19-2019
03:56 PM
|
1
|
5
|
4017
|
|
POST
|
Hi Kyle, I would recommend to write any data you want to persist across projects to this folder: var settingsPath = System.IO.Path.Combine (Environment.GetFolderPath(System.Environment.SpecialFolder.CommonDocuments),
"ArcGIS", "ArcGISPro", "Settings"); ArcGIS Pro is already using the "ArcGIS\ArcGISPro" folder in the common documents folder across projects. You can read/write your settings from/to a file in that common location. I am not sure about you html file question. I don't think you can read a json file from within an html file that is stored on your local disk, I am pretty sure this results in some type of access exception. However, you could write your configuration in form of html so that it is human readable and parse the file in order to get your configuration settings.
... View more
12-27-2018
08:53 AM
|
0
|
0
|
1066
|
|
POST
|
regarding your questions: >> So the only way I can organize any of the tools on this ribbon is through DAML code?? Yes >> With this "Customize the Ribbon", how do I move items Up/Down? Like I mentioned in my previous reply, you can only move items up/down if you make your own group etc. not if you want to modify a group defined in DAML. Below is an example of a group that I created using the 'Customize the Ribbon' interface, and as you can see I can use the up/down to arrange those items: If you really think this is a needed ArcGIS Pro feature you can suggest the idea on GeoNet | ArcGIS Ideas (https://community.esri.com/community/arcgis-ideas) under ArcGIS Desktop, using these guidelines: https://community.esri.com/ideas/13020-geonet-ideas-category-pro since there is no Pro feature Category available. This discussion should also be moved to 'ArcGIS Pro' since the Pro SDK discussion is not the right platform for Pro features.
... View more
11-30-2018
09:20 AM
|
1
|
0
|
687
|
|
POST
|
When you use the "customize the ribbon (Options)" interface, re-ordering of sub-elements under existing tabs or groups is not supported. In other words if a tab or a group is defined in DAML (either out-of-box or through an Add-in / Configuration) the order cannot be customized, instead the order is dictated by the DAML. If you add a new group or tab through the customize the ribbon (Options) interface then you can re-order those sub-elements. This is done by using the up / down arrow buttons on the right side of the dialog (note that these buttons are only enabled if re-ordering is supported). Using the customize the ribbon interface you can also Remove sub-elements as part of the customization, or you can Add new elements to an existing tab or group. You cannot delete a button on the top (order) of a group and then add the same button on the bottom of the same group since DAML is transactional and deletes are done last (for that group) and hence the button is deleted from the group. Also to get back you to the original ribbon configuration (as defined in the DAML) you can use the 'Customization Reset' drop down to reset either all or a sub-selection of the ribbon. Not sure what happened on your screenshot, but the 'customization reset' should have cleared everything.
... View more
11-29-2018
01:58 PM
|
1
|
3
|
3573
|
|
POST
|
I adapted your code snippet to an Add-in button and fixed your code. One feature in States is selected by using one feature from ProjectArea and the envelope of the selected States record is used to zoom the map to the selection. This is what I see after I click my test button: This is the code behind for the button: protected override async void OnClick()
{
{
Map m = MapView.Active.Map;
if (m != null)
{
var env = await SelectStateAsync(m);
if (env != null) await MapView.Active.ZoomToAsync(env);
}
}
}
private Task<Envelope> SelectStateAsync(Map m)
{
return QueuedTask.Run<Envelope>(() =>
{
Envelope selectionEnvelope = null;
FeatureLayer fl1 = m.FindLayers("ProjectArea").FirstOrDefault() as FeatureLayer;
if (fl1 == null) return selectionEnvelope;
QueryFilter queryFilter = new QueryFilter();
using (ArcGIS.Core.Data.RowCursor rowCursor = fl1.Search(queryFilter = null))
{
//Grab the first record (and hopefully only record)
while (rowCursor.MoveNext())
{
//Grab the features geometry
Feature feature1 = rowCursor.Current as Feature;
Geometry geo = feature1.GetShape().Clone();
//Set up a spatial query
var spatialQuery = new SpatialQueryFilter()
{
FilterGeometry = geo,
SpatialRelationship = SpatialRelationship.Intersects
};
//Reference county layer and apply spatial query
FeatureLayer fl2 = m.FindLayers("States").FirstOrDefault() as FeatureLayer;
if (fl2 != null)
{
// this selects the feature(s) in fl2
var selection = fl2.Select(spatialQuery);
// this get the envelope
using (RowCursor rowCursor2 = selection.Search())
{
if (rowCursor2.MoveNext())
{
// stop with the first extent
Geometry geo1 = (rowCursor2.Current as Feature).GetShape().Clone();
selectionEnvelope = geo1.Extent.Expand(1.1, 1.1, true);
}
}
}
}
}
return selectionEnvelope;
});
} Hope this helps.
... View more
11-15-2018
04:42 PM
|
1
|
8
|
3864
|
|
POST
|
You can take a look at this sample: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing/CallScriptFromNet
... View more
11-09-2018
07:55 AM
|
1
|
1
|
2782
|
|
POST
|
I made a sample add-in that creates two feature classes in your default file geodatabase (including a description attribute) and then adds features to each one of the newly created feature classes. I tested this add-in in ArcGIS Pro 2.2.3 and I cannot duplicate your issue. I added the project to the community samples here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Editing/AddFeatureTest so you can compare it with your code. To debug the sample add-in you can open a new map and zoom into your neighborhood (the created features are close together). Click the 'Create Featureclasses' button and then the 'Add Features' button. The result looks like this:
... View more
10-11-2018
11:27 AM
|
0
|
0
|
4500
|
|
POST
|
If you look at the output of Map.Layers and compare it to the Contents Pane in ArcGIS Pro you will notice that only the topmost layers of the table of contents, which shows the layers in a hierarchy, are returned. When using Map.Layers you have to look at each item returned and then 'drill down' through all composite layers of each layer item. If you use GetLayersAsFlattenedList you get all layers regardless of where in the table of content hierarchy the layer is located, so in essence the hierarchy is returned as a 'flattened list'.
... View more
10-10-2018
09:39 AM
|
0
|
1
|
3315
|
|
POST
|
Not sure how I can help you further without taking a look at the code or a sample with the same issue. Maybe one more thing to check would be to make sure that any data that is used to create a feature (i.e. attributes passed into the .Create method) are still in scope (and haven't been disposed yet) when you call .Execute.
... View more
10-09-2018
02:23 PM
|
0
|
2
|
4500
|
|
POST
|
Does your second 'button' function properly if you execute it first? It seems to me that some other issue is the cause for your problem, maybe a field name that doesn't exist or is misspelled? you should be able to perform as many edit operations as you like as long as you follow the workflow outlined above, so I think your code must have another cause for the error not the EditOperation class.
... View more
10-09-2018
12:55 PM
|
0
|
1
|
4500
|
|
POST
|
I think you are trying to use EditOperation for something it was not designed to do. You can't perform multiple operations in one EditOperation instance. Use one of the following two methods to get your edits to work: For the following examples I used the FeatureTest dataset from the community sample GitHub repo. To run the sample snippets below simply create an Add-in with one button and insert this code in the OnClick for the button's code-behind. As you can see the code creates ONE EditOperation instance, then creates two features, then finally calls ONE .Execute: if (MapView.Active == null) return;
try
{
var pointsLayer1 = MapView.Active.Map.GetLayersAsFlattenedList().Where((l) => l.Name == "TestPoints").FirstOrDefault();
if (pointsLayer1 == null) throw new Exception($@"Unable to find ""TestPoints"" Layer");
var polyLayer1 = MapView.Active.Map.GetLayersAsFlattenedList().Where((l) => l.Name == "TestPolygons").FirstOrDefault();
if (polyLayer1 == null) throw new Exception($@"Unable to find ""TestPolygons"" Layer");
QueuedTask.Run(() =>
{
var centerPt = MapView.Active.Map.GetDefaultExtent().Center;
var editOp = new EditOperation();
editOp.Name = "Simple edit operation";
editOp.Create(pointsLayer1, centerPt);
editOp.Create(polyLayer1, GeometryEngine.Instance.Buffer(centerPt, 50.0));
//Execute the operations
var result = editOp.Execute();
if (result != true || editOp.IsSucceeded != true)
throw new Exception($@"Edit failed: {editOp.ErrorMessage}");
MessageBox.Show("Edit complete");
});
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex.ToString()}");
} This will work for you. If you want to execute two operations (in order to get two undo / redo stacks) you can use this sample, where you create two EditOperation Instances and call .Execute for each instance. if (MapView.Active == null) return;
try
{
var pointsLayer1 = MapView.Active.Map.GetLayersAsFlattenedList().Where((l) => l.Name == "TestPoints").FirstOrDefault();
if (pointsLayer1 == null) throw new Exception($@"Unable to find ""TestPoints"" Layer");
var polyLayer1 = MapView.Active.Map.GetLayersAsFlattenedList().Where((l) => l.Name == "TestPolygons").FirstOrDefault();
if (polyLayer1 == null) throw new Exception($@"Unable to find ""TestPolygons"" Layer");
QueuedTask.Run(() =>
{
var centerPt = MapView.Active.Map.GetDefaultExtent().Center;
var editOp = new EditOperation();
editOp.Name = "1. edit operation";
editOp.Create(pointsLayer1, centerPt);
var result1 = editOp.Execute();
if (result1 != true || editOp.IsSucceeded != true)
throw new Exception($@"Edit 1 failed: {editOp.ErrorMessage}");
MessageBox.Show("Edit 1 complete");
editOp = new EditOperation();
editOp.Name = "2. edit operation";
editOp.Create(polyLayer1, GeometryEngine.Instance.Buffer(centerPt, 50.0));
//Execute the operations
var result2 = editOp.Execute();
if (result2 != true || editOp.IsSucceeded != true)
throw new Exception($@"Edit 2 failed: {editOp.ErrorMessage}");
MessageBox.Show("Edit 2 complete");
});
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex.ToString()}");
} As mentioned before the difference is the undo / redo stack... you get one entry for each 'EditOperation'.
... View more
10-09-2018
12:23 AM
|
1
|
3
|
4500
|
|
POST
|
You cannot perform 'nested' edit operations, instead you would use the same 'EditOperation' instance to perform all your edits (or feature creations) as outlined here: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#edit-operations To see an example or multiple creations scroll to the 'The first example shows 3 separate creates' paragraph in the referenced section. If you need to reference the object id of a newly created feature in a subsequent edit operation you can take a look at this section: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#chaining-edit-operations which describes a 'chained edit operation'.
... View more
10-08-2018
01:41 PM
|
0
|
5
|
4500
|
|
POST
|
You can look at this example: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/b76a6625dc3fa2e4287c1b39ab4b95e3a8f2b04b/Map-Exploration/MapToolWithOverlayControl It is using an overlay control to show the coordinates in lat/long.
... View more
10-08-2018
01:31 PM
|
1
|
0
|
1409
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 10:48 AM | |
| 1 | 05-24-2021 09:04 AM | |
| 1 | 12-03-2020 08:44 AM | |
| 1 | 10-07-2025 07:27 AM | |
| 2 | 12-29-2025 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-30-2026
03:25 PM
|