|
POST
|
Hi, I try to execute some filegeodatabase changes in one EditOperation Callback. Changes are made in one table and some records searched by query. Callback works fine. Changes are made, but there is no undo operation in undo/redo stack. I have tried to set EditOperationType to Long but without success. Is it bug or feature?
... View more
10-17-2019
07:22 AM
|
0
|
2
|
1042
|
|
POST
|
Hi Naresh, Try at first Esri sample with dockpane. If sample does not work on VM then write ticket to esri support. Else check all libraries included in your dockpane xaml. We all libraries which use more than one Add-in add to GAC, all Add-ins put to special folder defined in ArcGIS Pro Add-ins manager.
... View more
10-16-2019
02:40 AM
|
0
|
0
|
1556
|
|
POST
|
Hi Sam, Try code below. FilePath is your raster path in geodatabase. Instead of creating layer you can do what you want private Task AddToMap() { return QueuedTask.Run(() => { try { // first we create an 'Item' using itemfactory Item currentItem = ItemFactory.Instance.Create(FilePath); // Finally add the feature service to the map // if we have an item that can be turned into a layer // add it to the map if (LayerFactory.Instance.CanCreateLayerFrom(currentItem)) LayerFactory.Instance.CreateLayer(currentItem, MapView.Active.Map); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error while adding vector tile to map"); } }); }
... View more
10-01-2019
10:31 PM
|
0
|
1
|
1262
|
|
POST
|
Hi Susan, I am not really sure that DeleteFields tool exists. DeleteField - yes. Try delete one by one field at first. Next question is the structure of your FieldNames variable. If you use the same FieldNames variable for delete then it will not work, because for adding field you need more than just field name (type, length and etc.). For deleting it is enough only field name. I have just tested arcpy script where y and x is table field names: arcpy.management.DeleteField('mytable', "y;x") It works fine
... View more
09-25-2019
11:56 PM
|
0
|
0
|
1051
|
|
POST
|
Hi Sam, For raster layers: // Working with rasters requires the MCT. await QueuedTask.Run(() => { // Get the raster from the current selected raster layer. Raster inputRaster = currentRasterLayer.GetRaster(); var spatRef= inputRaster.GetSpatialReference(); }); For feature layers: // Working with rasters requires the MCT. await QueuedTask.Run(() => { // get the feature class associated with the layer var featureClass = pointFeatureLayer.GetTable() as FeatureClass; // retrieve the class definition of the point feature class var classDefinition = featureClass.GetDefinition() as FeatureClassDefinition; // store the spatial reference as its own variable var spatialReference = classDefinition.GetSpatialReference(); });
... View more
09-19-2019
04:13 AM
|
2
|
1
|
2096
|
|
POST
|
David you can manage order of loading Add-ins. So you can make that module which responsible for project settings and licensing will be loaded first. I have the same situation in my development project: project settings and licensing. I call it core module. In the config.daml file of core module add to module attribute autoLoad="true". For other Add-ins modules add dependencies from core module like this: <dependencies> <!-- id of "core module" --> <dependency name="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}" /> </dependencies> There is no timing issues or other problems reading project settings
... View more
09-16-2019
07:24 AM
|
1
|
2
|
1947
|
|
POST
|
Hi Anandha, To select features from particular layer set Tool property UseSnapping to true. Then switch off snapping on all map layers except layer you need. In sample all snappable layers are separated by ";" in the input string. public static async Task ConfigureSnappingAsync(string sLayerNames) { // General Snapping Snapping.IsEnabled = true; Snapping.SetSnapMode(SnapMode.Point, true); // Snapping on any point Feature Layers var flayers = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().ToList(); if (flayers.Count() > 0) { //GetDefinition and SetDefinition must be called inside QueuedTask await QueuedTask.Run(() => { string sNames = string.Empty; if (!string.IsNullOrEmpty(sLayerNames)) { sNames = sLayerNames.ToUpper(); } foreach (var fl in flayers) { var layerDef = fl.GetDefinition() as CIMGeoFeatureLayerBase; if (string.IsNullOrEmpty(sNames)) { if (!layerDef.Snappable) { layerDef.Snappable = true; fl.SetDefinition(layerDef); } } else { string searchName = fl.Name.ToUpper() + ";"; layerDef.Snappable = sNames.Contains(searchName); fl.SetDefinition(layerDef); } } }); } } The next step is more complicated. There are two ways: 1. Control mouse cursor (set direction you want) 2. Change cursor icon on mouse move then user selects wrong direction and do not accept wrong position on mouse down.
... View more
09-15-2019
11:27 PM
|
0
|
0
|
853
|
|
POST
|
Hi David, I have similar task and I need settings all time of work with ArcGIS Pro. So I create singleton class with Dictionary type property. On OnReadSettingsAsync() I copy all my project settings to singleton. When I need project settings, I call singleton class for getting value I need. You can use your module class for this if your all Add-ins are in the same module. In other case you can get many cross-references.
... View more
09-15-2019
11:10 PM
|
2
|
4
|
1947
|
|
POST
|
Hi Serban, I do it in that way. My ProWindow Class: public partial class TestWindow : ProWindow Creating new window: var testWindow = new TestWindow(); testWindow.Owner = FrameworkApplication.Current.MainWindow; testWindow.ShowDialog();
... View more
09-09-2019
02:07 AM
|
1
|
0
|
952
|
|
POST
|
Hi Scott, The tool name is "near_analysis". From Python Script geoprocessing tool name you need to change group and tool name places and change '.' to '_'. If arcpy.analysis.Near(r"Sites", r"'Customers'", "1000 Meters", "NO_LOCATION", "NO_ANGLE", "PLANAR") then Geoprocessing.OpenToolDialog("near_analysis", parameters);
... View more
09-05-2019
12:41 AM
|
0
|
0
|
1366
|
|
POST
|
Hi Berend, Look at the ArcGIS Pro SDK samples on GitHub : https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/BackStage_PropertyPage
... View more
09-03-2019
06:20 AM
|
1
|
1
|
1271
|
|
POST
|
Hi James, There is simpliest way to do what you need. Add to your QueryFilter variable PostfixClause and run Search on your table like this: public async Task SearchingATable() { try { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) using (Table table = geodatabase.OpenDataset<Table>("EmployeeInfo")) { QueryFilter queryFilter = new QueryFilter { WhereClause = "COSTCTRN = 'Information Technology'", SubFields = "KNOWNAS, OFFICE, LOCATION", PostfixClause = "ORDER BY OFFICE" }; using (RowCursor rowCursor = table.Search(queryFilter, false)) { while (rowCursor.MoveNext()) { using (Row row = rowCursor.Current) { string location = Convert.ToString(row["LOCATION"]); string knownAs = Convert.ToString(row["KNOWNAS"]); } } } } }); } catch (GeodatabaseFieldException fieldException) { // One of the fields in the where clause might not exist. There are multiple ways this can be handled: // Handle error appropriately } catch (Exception exception) { // logger.Error(exception.Message); } } Sample from ArcGIS Pro snippets: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase
... View more
08-29-2019
10:37 PM
|
0
|
1
|
2734
|
|
POST
|
Hi Sam, I use raster reclassify from geoprocessing. Below is part of code: // out_raster = arcpy.sa.Reclassify("density1000", "VALUE", "2000 1;100000 2", "DATA"); var parameters = Geoprocessing.MakeValueArray(sDlRaster, "VALUE", sReclassString, sOutRaster); var environments = Geoprocessing.MakeEnvironmentArray(workspace: sWorkspace); var gpResult = Geoprocessing.ExecuteToolAsync("Reclassify_sa", parameters, environments, CancelableProgressor.None, GPExecuteToolFlags.AddToHistory); gpResult.Wait(); You can execute every geoprocessing function you need. Get from executed command report python script ant then using python script syntax arrange your parameters in c# code. First commented line in my code is python script line. I do it in that way because all information about geoprocessing functions and samples are in python.
... View more
08-26-2019
10:55 PM
|
2
|
1
|
1221
|
|
POST
|
Hi Richard, It could be order issue of XAML attributes or parent control sets some attributes for it’s childs
... View more
08-26-2019
07:02 AM
|
0
|
0
|
1689
|
|
POST
|
Hi Richard, I have tried to add your xaml to my dialog on ArcGIS pro 2.4. I think it works fine. I have changed bindings to text values
... View more
08-19-2019
09:07 AM
|
1
|
2
|
1689
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 04-24-2026 08:33 AM | |
| 1 | 03-23-2026 11:44 AM | |
| 1 | 05-22-2024 11:48 PM | |
| 1 | 02-27-2026 10:33 AM | |
| 1 | 01-07-2026 10:44 AM |
| Online Status |
Online
|
| Date Last Visited |
6 hours ago
|