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
yesterday
|
0
|
0
|
5
|
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
yesterday
|
0
|
0
|
12
|
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
Monday
|
1
|
0
|
37
|
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
Monday
|
1
|
0
|
41
|
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
2 weeks ago
|
0
|
0
|
37
|
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
2 weeks ago
|
1
|
0
|
224
|
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
2 weeks ago
|
0
|
0
|
39
|
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
2 weeks ago
|
0
|
1
|
226
|
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
|
0
|
0
|
717
|
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
|
728
|
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
|
664
|
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
|
758
|
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
|
1077
|
POST
|
Your approach to move your source code to a previous release version of ArcGIS Pro is correct: You have to move the source code to a development machine with ArcGIS Pro 3.1 installed. You also have to install the matching ArcGIS Pro SDK (3.1 in your case) Visual Studio extensions. You open your Add-in solution in Visual Studio and change the project's 'Target Framework' back to .NET 6.0, clean the project, and then rebuild the project. Use the ArcGIS Pro SDK's 'Pro Fix References' tool (right click on the solution or project file) if the reference path to ArcGIS Pro assemblies changed. It is possible that you get errors when you rebuild the add-in. Errors can be caused by functionality added by .NET 8.0 (in my test i noticed that the '[]' collection expression is not valid in .NET 6.0) and errors can be caused by functionality added by an ArcGIS Pro release. In my test (i downgraded from 3.5 to 3.2) and i didn't get any errors by non-existing functions or assemblies of ArcGIS Pro 3.2. But you can get errors (like your "KnowledgeGraph" depended assembly that were caused by additions to future ArcGIS Pro releases. Once your Add-in builds under the older ArcGIS Pro release you have to update the desktopVersion attribute in the config.daml file to reflect the minimum required version you want your add-in to work with. See here: ProConcepts Advanced Topics · Esri/arcgis-pro-sdk Wiki "Add-ins and configurations are forwards compatible across all minor versions of ArcGIS Pro. Add-ins and configurations are not forward compatible across major versions (eg 2.x, 3.x, etc). Add-ins and configurations are not backwards compatible across any versions of ArcGIS Pro." Regarding the changes in each release can find the 'What's new' for all editions here: Home · Esri/arcgis-pro-sdk Wiki
... View more
06-23-2025
03:23 PM
|
2
|
1
|
475
|
Title | Kudos | Posted |
---|---|---|
1 | Monday | |
1 | Monday | |
1 | 2 weeks ago | |
1 | 07-15-2022 07:30 AM | |
1 | 07-14-2025 02:08 PM |
Online Status |
Online
|
Date Last Visited |
2 hours ago
|