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
a week ago
|
0
|
0
|
30
|
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
a week ago
|
1
|
0
|
172
|
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
a week ago
|
0
|
0
|
32
|
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
a week ago
|
0
|
1
|
174
|
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
|
704
|
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
|
724
|
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
|
659
|
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
|
754
|
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
|
1070
|
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
|
461
|
POST
|
You didn't share your tool's OnSketchComplete method. Is it possible that it contains code to create an annotation feature? If you create a Construction Tool from the ArcGIS Pro SDK item templates you notice that this code is inserted with the template: // Create an edit operation
var createOperation = new EditOperation();
createOperation.Name = string.Format("Create {0}", CurrentTemplate.Layer.Name);
createOperation.SelectNewFeatures = true;
// Queue feature creation
createOperation.Create(CurrentTemplate, geometry);
// Execute the operation
return createOperation.ExecuteAsync(); this snippet will actually create an annotation feature using the current template (which usually has the string 'Text' as the default value): My guess is that only a 'Create' call on an EditOperation that is using the current template will produce your 'Text' annotation entry. Also, if you get the text for the annotation feature from a Query Cursor make sure to 'copy' the text string when you retrieve the string from your current feature. I would do the same if you get the geometry via a feature cursor, make sure to .Clone() the geometry.
... View more
06-17-2025
07:48 AM
|
0
|
0
|
882
|
POST
|
The 'Text' string you're seeing is coming from the annotation editing template. Somehow, there must be an extra 'createOperation.Create' function call that adds the default template settings to the annotation feature class. I wrote a sample add-in which is an annotation tool that allows you to select a set of point features (cities in my sample) via rectangular selection and then creates annotation features for all selected point features. I attached the sample code and also the project file i used for testing. Maybe you can compare the sample code to your code and find the difference. I tested my addin in both 3.4 and 3.5. To use the sample, open the attached SampleAnno.aprx, use the Create Features dockpane to select the 'Retrofit Annotation for points' tool and rubber band select a few cities to create the matching annotation strings.
... View more
06-16-2025
09:18 AM
|
0
|
1
|
917
|
POST
|
I tried this Addin using ArcGIS Pro 3.4 and i see the .lock files in 3.4 as well. As far as i can tell, the geodatabase connection must still be open. I think the same happens when you use the Catalog dockpane and manually open the Geodatabase: a .lock file is created and stays until you close Pro. I don't see a change in behavior between 3.4 and 3.5.
... View more
06-06-2025
11:55 AM
|
1
|
0
|
666
|
POST
|
I made a small sample add-in that imports a csv (included as add-in content) and adds the data into a new feature class in your project's default geodatabase. To run the add-in start with a new [empty] map [template] and open the 'FGB Importer' tab. Click the 'Show FGB Importer' button to open the Importer dockpane. On the dockpane all paths etc. should be filled in. Just click the 'Import into F/C' button. This will create a new feature class in the given geodatabase and then adds the csv data to that feature class. Maybe i left out something in my code, but i also have the remaining .lock file in my geodatabase folder. I am currently running 3.6 but i will try 3.4 tomorrow. I will add this code to the community samples with the 3.6 release, it hasn't been fully debugged.
... View more
06-05-2025
05:03 PM
|
0
|
0
|
688
|
Title | Kudos | Posted |
---|---|---|
1 | a week ago | |
1 | 07-15-2022 07:30 AM | |
1 | 07-14-2025 02:08 PM | |
1 | 07-09-2025 12:13 PM | |
2 | 06-23-2025 03:23 PM |
Online Status |
Offline
|
Date Last Visited |
Wednesday
|