|
POST
|
Not sure if this will work in your use case, but you can call the built-in ArcGIS Pro 'Move Vertices' function programmatically. Just make sure that all edit conditions are met (i.e. the feature you want to move has been selected). This code snippet worked for me: protected override void OnClick()
{
try
{
QueuedTask.Run(() =>
{
// Ensure that there is only a single selected feature
var mapView = MapView.Active;
if (mapView == null)
{
MessageBox.Show("No active map view", "MoveSelectedFeature");
return;
}
var selectedFeatures = mapView.Map.GetSelection();
if (selectedFeatures.Count != 1)
{
MessageBox.Show("Please select a single feature to move.", "MoveSelectedFeature");
return;
}
// Use FrameworkApplication.GetPlugInWrapper to find the Move tool and execute the tool
if (FrameworkApplication.GetPlugInWrapper("esri_editing_EditVerticesMove") is ICommand moveToolCmd)
{
if (moveToolCmd.CanExecute(null))
moveToolCmd.Execute(null);
}
else
{
MessageBox.Show("Could not find the Move tool command.", "MoveSelectedFeature");
return;
}
});
}
catch (Exception ex)
{
MessageBox.Show($"MoveSelectedFeature failed. {ex.Message}", "MoveSelectedFeature");
}
}
... View more
10-29-2025
10:48 AM
|
0
|
0
|
288
|
|
POST
|
There is a community sample that shows the usage of ProgressorSource: arcgis-pro-sdk-community-samples/Framework/ProgressDialog at 15f436c4256bffdba30e7bf2e6f1cb9c8c2eaa8d · Esri/arcgis-pro-sdk-community-samples
... View more
10-28-2025
09:21 AM
|
0
|
0
|
135
|
|
POST
|
There is a community sample that shows how to do this: arcgis-pro-sdk-community-samples/MVVM-XAML/DockpaneWithComboDropdown at master · Esri/arcgis-pro-sdk-community-samples
... View more
10-07-2025
07:27 AM
|
0
|
0
|
222
|
|
POST
|
Since you already have a sorted dictionary (i suppose sorted in the order you need) you can add the [object id] query result to the value of that already existing dictionary. When you get the query result row/feature simply use sortedDictionary[objectId].... to add your resulting queried columns to your already existing dictionary.
... View more
10-07-2025
07:20 AM
|
0
|
0
|
188
|
|
POST
|
It's difficult to decipher the parameters for some GP tools. I usually run the GP Tool that I want to embed in my code by hand using the Geoprocessing toolbox. After the tool completes successfully, I open the Geoprocessing History dockpane and right click on "history entry" and click on "Copy Python Command". When you look at the Python Command it looks like this: arcpy.conversion.ExportFeatures(
in_features="MyPoints",
out_features=r"C:\Data\ElectionData\ElectionData.gdb\MyPoints_ExportFeatures",
where_clause="Y2008_D > 82868",
use_field_alias_as_name="NOT_USE_ALIAS",
field_mapping='Y2008_D "2008 Dem Votes" true true false 8 Double 0 0,First,#,MyPoints,Y2008_D,-1,-1;Y2008_R "2008 GOP Votes" true true false 8 Double 0 0,First,#,MyPoints,Y2008_R,-1,-1;ORIG_FID "ORIG_FID" true true false 4 Long 0 0,First,#,MyPoints,ORIG_FID,-1,-1',
sort_field=None
) You can now use the string format to construct you parameters.
... View more
10-06-2025
01:19 PM
|
1
|
0
|
185
|
|
POST
|
Sorry about the delay we started to certify 3.6... I attached a sample ArcGIS Pro Add-in project that includes the python script used to publish a feature layer as a web layer. Because the code is using ExecuteToolAsync to run the python script the script can utilize the existing ArcGIS Pro portal connection eliminating the need to passing user name/ password to the script. here is the sample's readme: This solution file includes an example python script named MySharing.pyt which is included as 'Content' (Build action) in the add-in. The python script is stored in the .\Toolboxes\toolboxes folder and when this add-in is loaded in ArcGIS Pro the python script is available a script tool under the ArcGIS Pro Geoprocessing toolbox. You can run the python script from the Geoprocessing toolbox as shown here. 4. You can also run the python script from code as implemented in the 'Publish as Web Layer' button under the 'Custom Publishing' tab (RunPyScriptButton.cs).
... View more
10-06-2025
10:37 AM
|
1
|
0
|
277
|
|
POST
|
@HollyTorpey_LSA can you please send me the County feature class / table from your colleagues (you showed the screen shot with wingding corruption above) ? you can use the 'private message' icon (mail) on the top right of this screen to send me a zipped attachment. I tried to duplicate the problem programmatically, but it is working properly in my tests so far. Also, what are using to delete the field? GP Tool or DDL API? Finally, when you delete the field is the deleted field in the middle of your attribute columns schema or at the end? If possible i would like to get the 'good' and if you still have it the 'corrupted' data as well.
... View more
09-24-2025
05:08 PM
|
0
|
0
|
147
|
|
POST
|
After some digging we found this: An overview of the Publishing toolset—ArcGIS Pro | Documentation which indicates that it is possible to publish a feature layer as a web layer. It appears that to accomplish this is very complicated. I will try to publish a sample that publishes a feature layer as a web layer. I'll put the sample on this thread as well - if i can get it to work.
... View more
09-24-2025
09:12 AM
|
1
|
0
|
460
|
|
POST
|
From previous posts I guess that data is local and not network related. I am trying to duplicate this issue (programmatically) right now.
... View more
09-24-2025
08:44 AM
|
0
|
0
|
149
|
|
POST
|
I am trying to find the script / GP tool that can be used to 'share' or 'publish' a feature layer as a web layer. Until then you can at least present your users programmatically with the 'share feature layer as web layer' dockpane using this snippet: IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_sharing_SharingAsWebLayerPaneBtn");
if ((wrapper is ICommand command) && command.CanExecute(null))
command.Execute(null);
... View more
09-24-2025
08:34 AM
|
0
|
1
|
462
|
|
POST
|
@Aashis is correct, but if you want to use the assemblies in your ArcGIS Pro / bin folder you can model your code using this sample: arcgis-pro-sdk-community-samples/CoreHost/CoreHostResolveAssembly at master · Esri/arcgis-pro-sdk-community-samples The sample is using this code snippet to resolve the assembly path when the assembly is being loaded: // Resolve ArcGIS Pro assemblies.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveProAssemblyPath);
// Perform all your CoreHost tasks (API calls) in a method
// instead of in the Main method (you can't use the PRO API from within Main):
try
{
PerformCoreHostTask(args);
}
... View more
07-30-2025
12:03 PM
|
1
|
0
|
874
|
|
POST
|
I don't see another way, however, i think processing will be fast since the layer data is cached in memory. Here is my sample: 3141 records in 0.017 seconds. These are the code changes to measure the timing: // count rows in each feature layer
StringBuilder result = new StringBuilder();
await QueuedTask.Run(() =>
{
foreach (FeatureLayer layer in featureLayers)
{
// Get the row count for the feature layer
// this is not working since it is getting the underlying table (which has all records in
// the case where a layer is created with a 'select' clause
// long rowCount = layer.GetTable().GetCount();
// create a cursor for the layer (not the table)
var rowCursor = layer.Search();
long rowCount = 0;
var timer = new Stopwatch();
timer.Start();
while (rowCursor.MoveNext())
{
rowCount++;
}
timer.Stop();
var elapsedTime = timer.Elapsed;
result.AppendLine($"{layer.Name}: {rowCount} rows {elapsedTime:m\\:ss\\.fff} min.");
}
});
// Show the result in a message box
MessageBox.Show(result.ToString(), "Row Count Results", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information);
... View more
07-14-2025
02:08 PM
|
1
|
1
|
855
|
|
POST
|
I doubt that this is a problem with access to the 'Assembly cache' folder - Actually when you register your esriAddinX file it will get unzipped in that folder using your user credentials and consequently it might not be the script folder itself, but instead it might be a reference to another file from within the script. There are some Microsoft tools that you can use to check which file (or folder) is the cause of this 'access denied' error: Search for Microsoft's SysinternalsSuite which is a collection of useful Windows tools. One of the tools is called ProcMon64.exe (for 'Process Monitor) and this tool allows you to capture any file i/o events and the cause of potential errors: You can use this tool (running on the machine where the problem occurs) to see which file (access) is causing the issue.
... View more
07-10-2025
06:56 PM
|
0
|
0
|
770
|
|
POST
|
If you select all features in the newly created layer you can use GetSelection () and the selection count on the layer, otherwise you have to use a RowCursor on the FeatureLayer itself (not on the underlying FeatureClass or Table): try
{
// get all feature layers in the current map
var map = MapView.Active.Map;
if (map == null)
{
MessageBox.Show("No active map found.", "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
return;
}
var featureLayers = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().ToList();
if (featureLayers.Count == 0)
{
MessageBox.Show("No feature layers found in the active map.", "Information", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information);
return;
}
// count rows in each feature layer
StringBuilder result = new StringBuilder();
await QueuedTask.Run(() =>
{
foreach (FeatureLayer layer in featureLayers)
{
// Get the row count for the feature layer
// this is not working since it is getting the underlying table (which has all records in
// the case where a layer is created with a 'select' clause
// long rowCount = layer.GetTable().GetCount();
// create a cursor for the layer (not the table)
var rowCursor = layer.Search();
long rowCount = 0;
while (rowCursor.MoveNext())
{
rowCount++;
}
result.AppendLine($"{layer.Name}: {rowCount} rows");
}
});
// Show the result in a message box
MessageBox.Show(result.ToString(), "Row Count Results", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information);
}
catch (Exception ex)
{
MessageBox.Show($"An error occurred: {ex.Message}", "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
}
... View more
07-10-2025
08:24 AM
|
0
|
1
|
885
|
|
POST
|
The ArcGIS Pro SDK community samples repo contains an example of two Add-ins interfacing. Under the Framework folder you'll find AddInOne and AddInTwo and the shared component AddInShared. If you have a reusable versioned class library, you'll have to sign the add-in (and library) as @SelimDissem said above. If you just want to 'share' common source code between your two Add-ins you can also add a reference to your 'shared' CS source code as shown here (in which case, you don't need to worry about DLL versions):
... View more
07-09-2025
12:13 PM
|
1
|
1
|
1257
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-30-2025 12:03 PM | |
| 1 | 10-06-2025 01:19 PM | |
| 1 | 10-06-2025 10:37 AM | |
| 1 | 09-24-2025 09:12 AM | |
| 1 | 07-15-2022 07:30 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|