POST
|
I attached a small sample add-in project that has a Combo dropdown on the ArcGIS Pro ribbon and two dropdowns on a Dockpane. I am using a dictionary (keys and values) to 'feed' the dropdown content.
... View more
Wednesday
|
0
|
0
|
61
|
POST
|
You need to set your json file's properties (in your project file) to 'Build Action' = 'Content' and 'Copy to Output...' = 'Copy if Newer' Then in your Add-in use the following path to read the json file: // read the JSON file from the current assembly's executable folder
string asmblyPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string jsonFilePath = System.IO.Path.Combine(asmblyPath, "MyJsonFile.json");
// read the JSON file
string jsonString = System.IO.File.ReadAllText(jsonFilePath);
... View more
2 weeks ago
|
1
|
0
|
75
|
POST
|
Uma wrote a sample with a tree control that might help you out. arcgis-pro-sdk-community-samples/Editing/EditorInspectorUI at master · Esri/arcgis-pro-sdk-community-samples Did you try to emulate the dropdown selection options as it is shown on the Attribute editing dockpane as shown on the screenshot below? I will try to provide a sample implementation in the upcoming 3.5 release for the community samples.
... View more
2 weeks ago
|
0
|
1
|
57
|
POST
|
I am not sure if this will help you, but it seems to me that you can add code in your tool to deal with the hidden/visible state of your dockpane. for example: protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
// in order to find a dockpane you need to know it's DAML id
var pane = FrameworkApplication.DockPaneManager.Find("your_dockpane_id_here");
// determine visibility
bool visible = pane.IsVisible;
MessageBox.Show($"Dockpane is {(visible ? "visible" : "not visible")}", "Dockpane Visibility");
if (!visible) pane.Activate(true);
return base.OnSketchCompleteAsync(geometry);
}
... View more
2 weeks ago
|
0
|
0
|
58
|
POST
|
@mstranovsky Your code snippet is not applicable in an ArcGIS Pro Add-in. There are two patterns in ArcGIS Pro to deploy a ComboBox: 1) If you are using a Pro Combo box ribbon control you would load the 'Ribbon' Dropdown from a dictionary like this: internal class TestComboBox : ComboBox
{
private bool _isInitialized;
/// <summary>
/// Combo Box constructor
/// </summary>
public TestComboBox()
{
UpdateCombo();
}
// create a dictionary with an entry for each US state, the value should be the capital city of that state
private Dictionary<string, string> _stateCapitals = new Dictionary<string, string>
{
{ "Alabama", "Montgomery" },
{ "Alaska", "Juneau" },
{ "Arizona", "Phoenix" },
{ "Arkansas", "Little Rock" },
{ "California", "Sacramento" },
{ "Colorado", "Denver" },
{ "Connecticut", "Hartford" },
{ "Delaware", "Dover" },
{ "Florida", "Tallahassee" },
{ "Georgia", "Atlanta" }
};
/// <summary>
/// Updates the combo box with all the capitals of the US states
/// </summary>
private void UpdateCombo()
{
if (_isInitialized)
SelectedItem = ItemCollection.FirstOrDefault();
if (!_isInitialized)
{
// Updates the combo box with all the capital names of the US states
foreach (var capital in _stateCapitals.Values)
{
Add(new ComboBoxItem(capital));
}
_isInitialized = true;
}
Enabled = true;
SelectedItem = ItemCollection.FirstOrDefault();
}
/// <summary>
/// The on comboBox selection change event.
/// </summary>
/// <param name="item">The newly selected combo box item</param>
protected override void OnSelectionChange(ComboBoxItem item)
{
if (item == null) return;
if (string.IsNullOrEmpty(item.Text)) return;
}
} 2. If you are using a combobox on a Dockpane, you should use the MVVM pattern to populate the combobox content. In this case, please model your code after @SumitMishra_016 's sample snippet.
... View more
2 weeks ago
|
1
|
0
|
114
|
POST
|
Hi Lingraj, We are checking with our ArcGIS Pro Azure deployment team. They are testing out an Azure Serverless container later this week. We'll let you know what their findings are.
... View more
a month ago
|
0
|
0
|
76
|
POST
|
I attached a sample Button OnClick method that includes all parameters and environment settings to call the 'Topo to Raster' GP Tool. To figure out in what form to pass in the parameter values I usually use the following approach: - I run the GP Tool manually and define all needed parameters - After the GP Tool completes, I click the "Open History" link to open the Geoprocessing History tab - I right click on the GP Tool and select the "Copy Python Command" from the context menu. - I then paste the 'Python Command' syntax into a text editor to see the parameter value formats. - I use the python command's parameter format to fill in the parameters for the ExecuteToolAsync call
... View more
03-26-2025
07:54 AM
|
1
|
0
|
201
|
POST
|
Not sure what ProgressDialogModule.RunCancelableProgress in your snippet does, but if you use a ProgressorSource with a maximum number of steps the progsrc.Value has to match progsrc.Max before the ProgressorDialog goes away. I don't think you need pd.Show() or pd.Hide() as long as you use the Value and Max properties instead. For each completed step (with a total of progsrc.Max steps) increment progsrc.Value, when progsrc.Value is equal to progsrc.Max the progressor dialog closes. You can find a snippet here: CancelableProgressor Class—ArcGIS Pro
... View more
03-25-2025
12:03 PM
|
0
|
0
|
134
|
POST
|
I have experienced this issue myself and traced it back to some random issue with the XAML designer. The errors you are seeing are only 'XAML Designer' errors and usually the errors go away when you close the 'XAML Designer'. The error output is caused by a bug in the 'XAML Designer' and therefore you can 'build and run' the app and bring up your dockpane, even with these 'XAML Designer' errors. Sometimes i was able to fix the issue by closing the solution, deleting the obj and bin folders, reopening the solution and then performing a 'rebuild all'.
... View more
01-06-2025
02:39 PM
|
0
|
1
|
243
|
POST
|
It looks like there's a gap in the ArcGIS Pro API. Normally you would call FrameworkApplication.ContextMenuDataContext to get the 'underlying' (to your right click) tool. The problem is that the returned object is an ArcGIS Pro internal class and hence you can't use that class in your add-in. There is a workaround using reflection that allows you to access the underlying 'tool' context. However, be advised that this solution is outside the Pro API framework and hence subject to change. We will submit a new requirement to the Geoprocessing team for consideration. In order to get the current (right clicked) tool insert this code inside your 'OnClick' button function: protected override void OnClick()
{
try
{
var toolInfo = FrameworkApplication.ContextMenuDataContext; //as ArcGIS.Desktop.GeoProcessing.ToolInfoViewModel;
// internal class ToolInfo:
// public string Name
// public string Description
// public string ToolType
// public bool IsValid
// public string ToolBoxName
// public string FullPath
// public bool IsSystem
// public string toolName
string name = (string)toolInfo.GetType().GetProperty("Name").GetValue(toolInfo, null);
string description = (string)toolInfo.GetType().GetProperty("Description").GetValue(toolInfo, null);
string toolType = (string)toolInfo.GetType().GetProperty("ToolType").GetValue(toolInfo, null);
string toolBoxName = (string)toolInfo.GetType().GetProperty("ToolBoxName").GetValue(toolInfo, null);
string fullPath = (string)toolInfo.GetType().GetProperty("FullPath").GetValue(toolInfo, null);
string toolName = (string)toolInfo.GetType().GetProperty("toolName").GetValue(toolInfo, null);
bool isValid = (bool)toolInfo.GetType().GetProperty("IsValid").GetValue(toolInfo, null);
bool isSystem = (bool)toolInfo.GetType().GetProperty("IsSystem").GetValue(toolInfo, null);
string nl = Environment.NewLine;
MessageBox.Show($@"Type of toolInfo: {toolInfo.GetType().ToString()}{nl}"
+ $@"name: {name}{nl}"
+ $@"description: {description}{nl}"
+ $@"toolType: {toolType}{nl}"
+ $@"toolBoxName: {toolBoxName}{nl}"
+ $@"fullPath: {fullPath}{nl}"
+ $@"toolName: {toolName}{nl}"
+ $@"isValid: {isValid}{nl}"
+ $@"isSystem: {isSystem}{nl}");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} Sample output:
... View more
01-06-2025
02:15 PM
|
0
|
1
|
280
|
POST
|
Are you deleting the field using the UI or are you deleting the field programmatically or are you using a Geoprocessing tool? Can you provide a sample snippet?
... View more
01-03-2025
12:12 PM
|
1
|
1
|
524
|
POST
|
When you use ExecuteToolAsync in a loop, I would recommend setting the GPExecuteToolFlags to GPExecuteToolFlags.None (GPExecuteToolFlags Enumeration—ArcGIS Pro) except for your last loop. For your last ExecuteToolAsync call use GPExecuteToolFlags.Default
... View more
11-07-2024
07:56 AM
|
1
|
0
|
275
|
POST
|
If you drag an 'Item' from the Catalog pane (specifically a Geodatabase item) you will have a Feature Class or a Table. Feature Layers are part of the map, so you can't have a feature layer without adding a feature class to the map first. However, you can perform operations on Feature Classes as well as Tables. I attached a drag/drop sample the takes a dropped feature class (point) or table and displays it's content. The sample requires 3.3 Dragging a Point feature class Showing the dropped content
... View more
07-22-2024
03:36 PM
|
1
|
0
|
667
|
POST
|
I tried the drag and drop as well and found no additional issues. Regarding the 'esri_mapping_snapChipToggleButton' error you saw in your log file: It is possible that the initial exception thrown by the 'wrong thread' exception caused this issue. It is also possible that other add-ins were affected by this exception as well. When testing add-ins for exceptions is best to remove other add-ins during the test session. I checked the WorkingWithQueryDefinitionFilters code sample and it didn't make use of the 'esri_mapping_snapChipToggleButton' daml id.
... View more
06-03-2024
04:16 PM
|
0
|
3
|
1786
|
Title | Kudos | Posted |
---|---|---|
1 | 2 weeks ago | |
1 | 2 weeks ago | |
1 | 04-12-2023 11:58 AM | |
1 | 03-26-2025 07:54 AM | |
1 | 01-26-2023 01:46 PM |
Online Status |
Online
|
Date Last Visited |
22m ago
|