|
POST
|
This issue is caused by Visual Studio's XAML Designer. I ArcGIS Pro versions 2.7 and earlier the VS XAML designer was able to load XAML and display the appropriate styling properly. This used to work because Pro DLLs, which contain the SDK's resources used for styling, were built in mixed mode supporting both 32 and 64 bit. ArcGIS Pro is a 64 bit application and starting with version 2.8 Pro DLLs were built to support x64 bit only. This was necessary to resolve some compatibility issues with the CefSharp library. The XAML Designer is a 32 bit application and is not able to load any x64 bit DLLs, consequently you see error messages starting with ArcGIS Pro 2.8 when you open the XAML Designer. The error messages show 'DLL not found' which is misleading because the error messages should say that x64 DLLs can't be loaded. Microsoft saw this issue as a low priority to fix and promised to address this problem in the upcoming Visual Studio 2022, which is a x64 bit application with a x64 XAML Designer. However, I did notice that with the latest releases of Visual Studio 2019 'Hot Reload' for XAML has been implemented. This means that you can debug your add-in and make changes to your XAML in Visual Studio. After you save your XAML changes in Visual Studio (during the debug session) the add-in's GUI will be updated in real-time without having to restart the debug session.
... View more
06-03-2021
02:18 PM
|
1
|
0
|
8469
|
|
POST
|
Which Enterprise database are you using and what type of statistics are you trying to get?
... View more
06-03-2021
07:40 AM
|
0
|
0
|
2460
|
|
POST
|
To parse JSON returned by a service with a variable schema you would need to be able to retrieve schema definition to make sense of it. This means that you would need to know what constitutes a coordinate (x/y field names, or x/y/z, or long/lat or geometry type) , you would also need to know which fields are attributes and what type are those attribute fields are (date, number, string, ...). An example for this would be the ArcGIS Rest API. When you query an ArcGIS Rest API's feature service the JSON response would look like this: {
"objectIdFieldName": "<objectIdFieldName>",
"globalIdFieldName": "<globalIdFieldName>",
"geometryType": "<geometryType>", //for feature layers only
"spatialReference": <spatialReference>, //for feature layers only
"hasZ": <true|false>, //added in 10.1
"hasM": <true|false>, //added in 10.1
"fields": [
{"name": "<fieldName1>", "type" : "<fieldType1>", "alias" : "<fieldAlias1>", "length" : "<length1>"},
{"name": "<fieldName2>", "type" : "<fieldType2>", "alias" : "<fieldAlias2>", "length" : "<length2>"}
],
"features": [ //features will include geometry for feature layers only
<feature1>, <feature2>
]
} You can see from this example that the schema proceeds the actual feature data stored in the 'features' array. The first part of the JSON response is not variable and allows you to extract attribute column names and types. In order to parse this type of JSON and then process it you can utilize the C# dynamic type with Newtonsoft (aka Json.Net) as shown here: Querying JSON with dynamic (newtonsoft.com) Since your schema definition (the first part of the JSON response) has a known definition, as for example the fields array, you can now query all features and their attribute values, regardless of the column names coming back in a JSON response.
... View more
06-03-2021
07:30 AM
|
0
|
0
|
10703
|
|
POST
|
You can also reuse the existing ArcGIS Pro tools (and commands) in your add-in without having to re-create the code. You can find information on reusing Pro commands here: ProGuide Reusing Pro Commands Esri/arcgis-pro-sdk Wiki (github.com) And the following video from the last dev summit demonstrates how to re-use Pro commands in your dockpane. (446) ArcGIS Pro SDK for .NET: Practical Dockpane Design and Implementation - YouTube You have to advance the video to 35:30 for the relevant information.
... View more
06-02-2021
12:20 PM
|
1
|
2
|
6712
|
|
POST
|
Hi Brian, If you run into trouble with these WPF issues you can just post your XAML file(s), that allows us to look into any issues with themes and styling. Thanks, Wolf
... View more
06-01-2021
01:30 PM
|
2
|
0
|
8490
|
|
POST
|
This has been a known issue we first noticed in 2019 with the release of Visual Studio 2019, and it can occur randomly even throughout a debug session. The ArcGIS Pro development team looked into it and deemed it benign. The recommendation to work around this issue is the following: What you are seeing is one of "Managed Debugging Assistants" (MDA) and can be disabled by Debug->Exceptions ... > Expand the MDA node and uncheck the box against contextswitchdeadlock . Note: I usually turn off all 'MDA's as they are not relevant for debugging my add-ins.
... View more
06-01-2021
08:36 AM
|
0
|
1
|
8880
|
|
POST
|
The rotation information is stored in the layer's CIM definition. You can use the CIM Viewer tool to interrogate the layer's CIM defintion's content: Esri/arcgis-pro-sdk-cim-viewer (github.com) Once you activate the tool and make the desired symbology settings manually, you can then 'show the CIM' to view the layer's CIM definition. It will look like this: Once you have the CIM definition you can the write the code to get/set the CIM definition programmatically. In your case you are interested in the CIMRenderer. I supplied the code to read the CIM, but you can make changes to the renderer as well. There are some snippets and community samples on how to set a renderer. Once you make programmatic changes to the CIM you always have to use the corresponding 'Set' function to submit the changed CIM to the layer (i.e. GetRenderer() / SetRenderer(...)). Here is my sample [Button / OnClick] code to read the renderer's rotation settings: protected override void OnClick()
{
var pointLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(fl => fl.Name.Contains("TestPoint")).FirstOrDefault();
if (pointLayer == null) return;
QueuedTask.Run(() =>
{
//Get simple renderer from the feature layer
CIMSimpleRenderer currentRenderer = pointLayer.GetRenderer() as CIMSimpleRenderer;
if (currentRenderer == null)
return;
// check if ArrayOfCIMVisualVariable exists
if (currentRenderer.VisualVariables != null)
{
// check if CIMRotationVisualVariable exists
foreach (var visualVar in currentRenderer.VisualVariables)
{
if (visualVar is CIMRotationVisualVariable cimRotationVisualVariable)
{
// rotation field info is under VisualVariableInfoZ
var varInfoZ = cimRotationVisualVariable.VisualVariableInfoZ;
// ValueExpressionInfo holds CIMExpressionInfo
var varExpInfo = varInfoZ.ValueExpressionInfo;
MessageBox.Show($@"{varExpInfo.Expression} rotation type: {cimRotationVisualVariable.RotationTypeZ}");
}
}
}
});
} Using the code above on my sample data results in this:
... View more
06-01-2021
07:57 AM
|
0
|
0
|
2801
|
|
POST
|
GetItems returns a type of IEnumerable<MapProjectItem> As Kris mentioned above if you include System.Linq you will get a set of extension methods for any object that implements the IEnumerable interface (and other interfaces and classes as well) as for example: Enumerable.FirstOrDefault Method (System.Linq) | Microsoft Docs To understand LINQ (classes and interfaces that support queries that use Language-Integrated Query (LINQ)) better you can search for Microsoft for help on LINQ.
... View more
05-27-2021
10:55 AM
|
0
|
0
|
2850
|
|
POST
|
Neither ArcGIS Pro nor the Pro SDK support activating two tools at the same time. If you write your own tools you can 're-use' a tool from OnSketchComplete of another tool. I attached a sample project to demonstrate this pattern. The attached add-in contains two tools: the 'Line Anno' tool which allows to draw a line and places an annotation feature and the 'Draw line' tool that creates line feature and then uses the 'Line Anno' tool code to create the annotation feature attached to the line. When i use the 'Line Anno' tool the add-in places an annotation feature: then I use the 'Draw Line' tool to draw a line, which is used to create a new line feature, but once the line feature has been created the code of the 'Line Anno' is called with the same geometry: I attached the SampleAnno.ppkx to test the add-in and all source code.
... View more
05-26-2021
02:51 PM
|
4
|
0
|
3434
|
|
POST
|
I will take a look at this. As a workaround: ArcGIS Pro is using the Chromium Web Control and you can find a sample (also using a pane) here: arcgis-pro-sdk-community-samples/Framework/ChromiumWebBrowserSample at master · Esri/arcgis-pro-sdk-community-samples (github.com) and some documentation about the browser control here: ProConcepts Framework · Esri/arcgis-pro-sdk Wiki (github.com)
... View more
05-25-2021
08:05 AM
|
0
|
0
|
2138
|
|
POST
|
Also I would recommend to uncheck the Visual Studio option to 'Automatically update extensions' as shown here: ProGuide Installation and Upgrade · Esri/arcgis-pro-sdk Wiki (github.com) By default Visual Studio automatically checks this option so when a new release becomes available your ArcGIS Pro SDK is automatically upgraded.
... View more
05-24-2021
09:04 AM
|
1
|
0
|
7107
|
|
POST
|
Hi Brian, You have to make any updates to the UI from the UI thread. There is a sample utility function in this community sample called RunOnUIThread that allows you to switch threads and run an Action on the UI thread. arcgis-pro-sdk-community-samples/BookmarkDockpaneViewModel.cs at 44183d0d5a9bc5da6fb8b9229211cc707dd2b874 · Esri/arcgis-pro-sdk-community-samples (github.com) Depending on your use case you can also use the Dispatcher class as shown here: arcgis-pro-sdk-community-samples/Module1.cs at 44183d0d5a9bc5da6fb8b9229211cc707dd2b874 · Esri/arcgis-pro-sdk-community-samples (github.com) You mentioned 'Windows Form' objects which would exclude the use of synchronization patterns that are exclusive to WPF like BindingOperations.EnableCollectionSynchronization
... View more
05-21-2021
10:54 AM
|
1
|
0
|
1569
|
|
POST
|
You can try this method: ArcGIS Pro 2.8 API Reference Guide - CreateEllipticArcSegment(Double,Double,Coordinate2D,Double,SpatialReference) Method—ArcGIS Pro There is a sample snippet in the method description.
... View more
05-21-2021
08:40 AM
|
1
|
1
|
1515
|
|
POST
|
Hi Sunny, The reason why this works is that ArcGIS Pro supports multi-threading. You can read more here: ProConcepts Framework / Multithreading · Esri/arcgis-pro-sdk Wiki (github.com). When you program using the Pro SDK you need to worry only about two threads: The GUI thread (Graphical User Interface thread) and a single specialized worker thread called the Main CIM Thread or MCT. So if you write code that uses the GUI thread uninterrupted you will see the 'Program not responding' message as used to be the case with ArcMap and ArcObjects.
... View more
05-20-2021
02:48 PM
|
1
|
0
|
2447
|
|
DOC
|
@MiguelEduardoParedes The following snippet below should work for you. I was not able to test this snippet because I couldn't configure a WMS service that requires user/password credentials, probably because I am using an older version of ArcGIS server. Upgrading my ArcGIS Server will take a while.... try
{
// Create a connection to the WMS server
var serverConnection = new CIMInternetServerConnection
{
URL = @"https://sdk5.esri.com/arcgis/services/TestCreditsMap/MapServer/WMSServer",
User="test",
Password="test"
};
var connection = new CIMWMSServiceConnection { ServerConnection = serverConnection };
// Add a new layer to the map
await QueuedTask.Run(() =>
{
var layer = LayerFactory.Instance.CreateLayer(connection, MapView.Active.Map);
});
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex}");
}
... View more
05-19-2021
12:41 PM
|
0
|
0
|
5860
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-29-2025 10:48 AM | |
| 1 | 05-24-2021 09:04 AM | |
| 1 | 12-03-2020 08:44 AM | |
| 1 | 10-07-2025 07:27 AM | |
| 2 | 12-29-2025 10:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-21-2026
01:59 PM
|