|
POST
|
Mody, EditCompletedEvent fires _after_ the fact, when the transaction has completed so it cannot be cancelled as it is not longer running. You may want to look at the EditCompletingEvent which also provides a CancelEdit capability. It is explained here: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#editcompletingevent. API Reference: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic20522.html
... View more
12-01-2022
09:41 AM
|
0
|
0
|
2166
|
|
POST
|
Try running Pro with diagnostic mode enabled and then check the log file. More information here: https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Command-line-switches-for-ArcGISPro.exe#enable-dynamic-mode-event-logging (you might need to create a shortcut that contains the cmd line argument) It looks like your addin is getting loaded (as it appears on the ribbon) but is throwing an exception on creation (eg on a button click). There may be a dependency that is missing/not found but the log file should contain the exception and u can go from there.
... View more
11-29-2022
12:34 PM
|
0
|
0
|
2641
|
|
POST
|
There is a Mapview SelectFeatures that takes a spatial query as a parameter
... View more
11-16-2022
05:38 AM
|
0
|
0
|
2164
|
|
POST
|
I wasnt able to reproduce with a batch file - sorry not a python programmer. One thing I did do different was remove the QueuedTask but I dont think that is relevant. FWIW, I did find a few other suggestions on solving issues reading stdout: here: https://stackoverflow.com/questions/1145969/processinfo-and-redirectstandardoutput @echo OFF
ECHO This is a test
ECHO %0 %1 string result = "";
ProcessStartInfo start = new ProcessStartInfo();
start.CreateNoWindow = true;
start.FileName = @"E:\Data\SDK\Test\TestAddin\TestStdout.bat";
start.Arguments = "Hello";
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
using (Process process1 = Process.Start(start)) {
using (StreamReader reader = process1.StandardOutput) {
result = reader.ReadToEnd();
reader.Close();
process1.Close();
//return result;
}
}
System.Diagnostics.Debug.WriteLine(result);
//return result;
... View more
10-28-2022
11:41 AM
|
0
|
0
|
2341
|
|
POST
|
I think u may need to set the reference scale on your map. Try setting it to whatever is the scale when u place your graphics. By default it is 0 (no ref scale).
... View more
10-28-2022
10:28 AM
|
0
|
0
|
1245
|
|
POST
|
Nice work Oscar. One thing I thought I would mention: The module class is actually already global throughout the addin (by design). All classes can access it via the special "singleton" property called "Current". Therefore, if you wanted, you could add a "SelectedFeatures" property to your module class directly and access it that way. So it could look something like this: internal class Module1 : Module {
...
private Dictionary<MapMember, List<long>> _selFeatures;
//Any (non-private) module property or method can be accessed from
//anywhere within the addin
internal Dictionary<MapMember, List<long>> SelectedFeatures =>
_selFeatures ??= new Dictionary<MapMember, List<long>>();
//elsewhere...access the property via Module1.Current...
foreach(var kvp in Module1.Current.SelectedFeatures) {
... View more
10-27-2022
10:32 PM
|
1
|
1
|
2289
|
|
POST
|
The Module is probably the best place. There is an initialize method in the Module which is probably a good spot. I would also set your module autoLoad attribute to true in the Config.daml. <modules>
<insertModule id="...." className="Module1" autoLoad="true"
caption="Module1"> internal class Module1 : Module {
private static Module1 _this = null;
...
protected override bool Initialize()
{
//TODO subscribe to the mapping event here
return true;
}
... View more
10-27-2022
11:58 AM
|
0
|
1
|
2305
|
|
POST
|
First thing to check are your assembly references. Check under Dependencies\Assemblies. A common issue with sharing addin code is that the assembly reference paths are can be different from machine to machine. If this is the problem then simply change the assembly locations in your copy of the project to the correct location based on the install path of _your_ local ArcGIS Pro. We also provide a utility that will do this for you automatically. It is included as part of the 'ArcGIS Pro SDK Utilities` visx. Install that (if u haven't already) and when u right click in the VS project window there will be a "Pro Fix References" menu option. Simply click on it to have all assembly paths, etc. be fixed automatically. More information here: https://github.com/Esri/arcgis-pro-sdk/wiki#arcgis-pro-sdk-for-net-utilities
... View more
10-20-2022
11:30 AM
|
0
|
0
|
1500
|
|
POST
|
There is a lower level API called EsriHttpClient. You can use it to issue HTTP formatted GET requests (as well as POST, etc.) against the portal. In this way u can use the ArcGIS API as u mention, just parse the returned JSON using Newtonsoft.JSON as needed. Take a look at all the examples here: https://prodev.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9050.html which is part of the API Reference. They show various usages based off the ArcGIS REST API and will show u the pattern to use. There are also a couple of samples that use EsriHttpClient as well. Here's one you can look at for additional context: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Content/PortalInfoListAllFedServers
... View more
10-17-2022
06:11 PM
|
0
|
1
|
2000
|
|
POST
|
From google, this seem to be the most promising thread: https://9to5answer.com/visual-studio-xaml-designer-error-xdg0062-using-eventsetter-in-net-core-wpf-application
... View more
10-13-2022
10:13 AM
|
0
|
1
|
2439
|
|
POST
|
Subscribe to the MapSelectionChangedEvent. Any changes to the map selection via selection tool, via custom selection, etc. will fire the event. ArcGIS.Desktop.Mapping.Events.MapSelectionChangedEvent.Subscribe((args) => {
//If u are only interested in one particular map...
if (args.Map.Name == "The Map Name I am Interested In") {
System.Diagnostics.Debug.WriteLine("Selection changed");
var sel = args.Selection;//This is what is selected
if (sel.Count == 0) {
System.Diagnostics.Debug.WriteLine(" 0 features selected");
return;
}
//enumerate current selection - a series of keyvalue pairs
//key is the MapMember, Value is the list of OIDs
foreach(var kvp in sel.ToDictionary()) {
var oids = kvp.Value; //OIDs of the selected features
var oid_str_list = oids.Select(oid => oid.ToString()).ToList();
var oid_str = string.Join(",", oid_str_list);
System.Diagnostics.Debug.WriteLine(
$"{kvp.Key.Name}: {oid_str}");
if (kvp.Key is BasicFeatureLayer fl) {
//TODO selection is on a vector layer...
}
else if (kvp.Key is StandaloneTable tbl) {
//TODO selection is on a table...
}
//else if (....)
//{
// etc,etc.
//}
}
}
}); Note: In 2.x, the event argument syntax is slightly different. The Selection property is a Dictionary so there is no sel.ToDictionary() as such.
... View more
10-11-2022
02:23 PM
|
1
|
1
|
2351
|
|
POST
|
Hi Amadeus, i checked with the development team. Only JSON format is supported for LayerDocument. In Pro version 1.x, layer files with .lyr suffix could also be created with JSON format - hence the inclusion of both .lyr and .lyrx suffixes in the code example I referenced. The API reference for LayerDocument does correctly mention that .lyrx is the intended format. Arcmap .lyr files, which are binary format, are not supported via LayerDocument. Therefore the only workaround would be to create the layer via LayerFactory (which I think u were trying to avoid).
... View more
10-07-2022
10:25 AM
|
1
|
3
|
3319
|
|
POST
|
I did a google on "Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.1.0.0". Quite a bit of chatter about getting the version right, etc,etc. Leads me to wonder if u have the correct version of the System.Threading.Tasks.Extensions and System.Runtime.CompilerServices.Unsafe Nugets installed in addition?
... View more
10-07-2022
09:32 AM
|
0
|
1
|
714
|
|
POST
|
To create a standalone table programmatically u can use: StandaloneTableFactory.CreateStandaloneTable It takes a StandaloneTableCreationParams instance as the parameter. There is a code snippet on the API ref page showing usage/workflow. To add records via an addin, the best way is to use EditOeration.Create. There are lots of different overloads. I suspect that the one best suited for your purposes is this one: Create(MapMember, Dictionary). Pass in your standalone table instance along with a Dictionary of field names/attribute value keyvalue pairs. Any field that is missing from the Dictionary will be assumed to be null. U can find lots more code examples here: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#edit-operation-create-features Although these arent specifically creating a table row in many cases, they will give u a very good idea of the EditOperation pattern of usage. Note: StandaloneTable instances derive from MapMember so any method that consumes a MapMember will also consume a StandaloneTable. You can also read more on EditOperations in the Editor concepts doc.
... View more
10-07-2022
09:16 AM
|
0
|
0
|
2985
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-19-2026 10:29 AM | |
| 1 | 04-29-2026 02:06 PM | |
| 1 | 01-08-2026 02:03 PM | |
| 1 | 01-08-2026 02:15 PM | |
| 3 | 12-17-2025 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-31-2026
09:30 AM
|