|
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
|
1399
|
|
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
|
1308
|
|
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
|
2806
|
|
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
|
1271
|
|
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
|
1756
|
|
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
|
1756
|
|
POST
|
Hi Than, Have you tried to look at snippets page? https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Raster There are few snippets with RasterCursor and PixelBlock
... View more
08-19-2019
02:32 AM
|
0
|
2
|
1599
|
|
POST
|
Hi Uma, The only one difference in our code is obtaining RasterLayer. You take it from map, in my add-in I create it from LayerFactory. I will check is it work by taking from map.
... View more
07-31-2019
05:58 AM
|
0
|
0
|
1641
|
|
POST
|
Hi Khamilie, I use combobox in my custom ribbon, but I call my own method to update combobox content. But you need to know the place where or when your combobox content changes. I created property for combobox in my add-in module class MyComboBox. Set it in combobox constructor: MyModule.Current.MyComboBox = this; And somewhere call method to update: MyModule.Current.MyComboBox.UpdateComboboxContent();
... View more
07-30-2019
12:02 AM
|
2
|
1
|
2289
|
|
POST
|
Hi Uma, Thank you for your efforts. Now it works with my text field, but doesn’t work with “Value” field. There is no view of the layer as in my picture in previous answer. The same things with recalculating colorizer we do in ArcObjects. So nothing changes ☺ It is strange that unique value rendering works fine on featureclasses without recalculating values. Thanks again.
... View more
07-29-2019
11:13 PM
|
0
|
5
|
8728
|
|
POST
|
Hi, I would like to use ArcGIS Pro SDK ProgressDialog with Cancel button for long process with iterations. After some iterations I see that my process results reached some suitable values and I don't want to wait until the end of process. I press Cancel button and want to write results to file geodatabase. I get error "Edit operation failed.". If I wait until end of process all works fine. I checked with debugger and found interesting thing that saving stops without going inside editOperation.Callback. I make testing project with Callback without any editing and get the same results. Have anyone run into the same situation? To check it you can use ProgressDialog sample from ArcGIS Pro SDK samples. Inside public static Task RunCancelableProgress(CancelableProgressorSource cps, uint howLongInSeconds) add call to my test function: System.Diagnostics.Debug.WriteLine(string.Format("RunCancelableProgress: Canceled {0}", cps.Progressor.CancellationToken.IsCancellationRequested)); TestEditOperation(); // My testing function }, cps.Progressor); My function code: private static void TestEditOperation() { try { string message = String.Empty; bool bResult = false; // Create a FileGeodatabaseConnectionPath using the path to the gdb. Note: This can be a path to a .sde file. FileGeodatabaseConnectionPath geodatabaseConnectionPath = new FileGeodatabaseConnectionPath(new Uri(@"C:\Temp\results.gdb")); // Create a new Geodatabase object using the FileGeodatabaseConnectionPath. using (Geodatabase geodatabase = new Geodatabase(geodatabaseConnectionPath)) { using (FeatureClass featClass = geodatabase.OpenDataset<FeatureClass>("Sites")) { EditOperation editOperation = new EditOperation(); editOperation.Callback(context => { try { FeatureClassDefinition fcDefinition = featClass.GetDefinition(); } catch (GeodatabaseException exObj) { message = exObj.Message; } }, featClass); bResult = editOperation.Execute(); if (!bResult) { message = editOperation.ErrorMessage; System.Diagnostics.Debug.WriteLine(message, System.Reflection.Assembly.GetExecutingAssembly().FullName); } else { var tsk = Project.Current.SaveEditsAsync(); tsk.Wait(); if (!tsk.Result) { message = "Saving results failed"; System.Diagnostics.Debug.WriteLine(message, System.Reflection.Assembly.GetExecutingAssembly().FullName); bResult = false; } } if (!string.IsNullOrEmpty(message)) { MessageBox.Show(message); } } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message, System.Reflection.Assembly.GetExecutingAssembly().FullName); throw; } }
... View more
07-24-2019
04:24 AM
|
0
|
0
|
1270
|
|
POST
|
Hi Kevin, Try this to get selected layers, then from layer you can get datasource and etc.: BasicFeatureLayer layer = null; await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { //find selected layer if (MapView.Active.GetSelectedLayers().Count == 0) { MessageBox.Show("Select a feature class from the Content 'Table of Content' first."); return; } layer = MapView.Active.GetSelectedLayers()[0] as BasicFeatureLayer; });
... View more
07-23-2019
11:00 PM
|
0
|
7
|
6750
|
|
POST
|
Hi Uma, I have changed color ramp to show that code does not work. I have used color ramp “Green Blues”. Below images before applying unique value colorizer and after Before: After: There is another one problem with unique value colorizer. My raster has two fields “Value” and “SLabel”(text). If I choose Field for colorizer “Value” I get no image on map at all. The color ramp is not what I choose too. Thanks Gintautas
... View more
07-22-2019
02:18 AM
|
0
|
7
|
8728
|
|
POST
|
Hi Uma, Thanks for reply. I have copied your code inside my test project. No changes. Result with your code Must be (result of the same color ramp from Symbology pane) When raster contains only one value (with your code):
... View more
07-18-2019
10:53 PM
|
0
|
9
|
8728
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 06-30-2026 10:14 PM | |
| 1 | 06-30-2026 01:43 PM | |
| 2 | 04-24-2026 08:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|