|
POST
|
Hi Brian, That was a tricky issue to solve... as far as the loading sequence you can find information here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Advanced-Topics#2-admin-well-known-folders Looking at this document i think the network share (in the registry) will trump everything else. Pro is using the following sequence: network path (registry) … user defined paths … and finally the default path for add-ins. The version tag in the config daml is actually only used to prevent an add-in from being loaded and run on an older version of Pro. As far as the 'down cast' from FeatureLayer to BasicFeatureLayer, the only impact here is that FeatureLayers (you are getting FeatureLayers from the layer list) has more functionality (via properties and methods) than BasicFeatureLayer from which it is derived from.
... View more
12-09-2020
10:53 AM
|
1
|
0
|
6301
|
|
POST
|
Hi Brian, This latest exception makes no sense ... a boolean local variable shouldn't be able to throw a null reference exception. One possibility would be that the code causing the exception is not in sync with your source code. So I would suggest at this time to make sure that we are in sync by closing all instances of ArcGIS Pro (even use Task Manager to make sure no 'hidden' Pro instance is running), then deleting all addins (by deleting everything in the ...\Documents\ArcGIS\AddIns folder), then rebuilding your add-in and checking for the exception.
... View more
12-09-2020
08:39 AM
|
0
|
0
|
2777
|
|
POST
|
Hi Brian, I can't see anything wrong (except the continue statement i added under the 'broken' condition), but let's try to replace one segment in your code with this: //Check for any Joins on layers with a selected feature
Boolean joinExists = false;
Boolean brokenExists = false;
var map = MapView.Active.Map;
foreach (FeatureLayer currentLayer in map.GetLayersAsFlattenedList().OfType<FeatureLayer>())
{
//***** where my original code get the NullReference exception
if (currentLayer.ConnectionStatus == ConnectionStatus.Broken)
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(currentLayer.Name.ToString() + " has a missing data source. Please remove or fix this layer before continuing.", "Missing Data Source");
brokenExists = true;
// added this to prevent exceptions in the remaing loop code
continue;
}
if ((currentLayer.GetTable().IsJoinedTable() == true) && (currentLayer.SelectionCount > 0))
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(currentLayer.Name.ToString() + " has a joined table. Please remove any joins before continuing.", "Joined table detected");
joinExists = true;
}
} Let's see if this is causing the NULL exception as well.
... View more
12-08-2020
03:48 PM
|
0
|
3
|
2783
|
|
POST
|
Let me check with product development, i will get back to you about this.
... View more
12-08-2020
01:18 PM
|
0
|
1
|
3042
|
|
POST
|
This is not normal. Usually, at least in my experience, Map tools activate with no noticeable delay. There are other issues that can cause a delay in activation. First ArcGIS Pro is using JIT (Just In Time) loading of your add-in (see https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#jit-loading ) which can cause a delay if your add-in takes a long time to load and/or initialize. Secondly, any activity in the mapview can cause a map tool's activation delay as well, so i would also watch for any map activities going on in the background.
... View more
12-08-2020
12:05 PM
|
0
|
3
|
3044
|
|
POST
|
You are correct that "Getting from the `LayersAdded` page to `LayerEventsArgs` isn't straightforward". We had this issue in our cross hairs for a while, it's a limitation in the third party software we are using for the API reference website generation. We are hoping to fix this 'linkage' problem in one of the upcoming releases.
... View more
12-08-2020
11:51 AM
|
0
|
0
|
2571
|
|
POST
|
Hi Mike, The ArcGIS Pro SDK wiki explains how to 'subscribe' to Pro Events using the Pro SDK in general: ProConcepts Framework Events Specifically when you subscribe to an LayerAddedEvent you have to look at the parameter required for the Subscribe method (API Reference) : public static SubscriptionToken Subscribe(
Action<LayerEventsArgs> action,
bool keepSubscriberAlive
) The parameter Action<LayerEventsArgs> indicates that you have to specify a 'delegate' (action method) here. The delegate action method has one parameter LayerEventsArgs and looking at the members of LayerEventsArgs you will notice that it contains a Layers property which contains the layers (as an enumeration) that are added. To test this i created an add-in module with a single button. The OnClick method for the button contains this test code: protected override void OnClick()
{
LayersAddedEvent.Subscribe((evtArgs) =>
{
System.Diagnostics.Debug.WriteLine("LayersAddedEvent");
foreach (var lyr in evtArgs.Layers)
{
System.Diagnostics.Debug.WriteLine($@"Added this layer: {lyr.Name}");
}
});
} To test this i click my button and then add a new layer to my map view and I get the following output in my Visual Studio output window: LayersAddedEvent Added this layer: TestMultiPoints
... View more
12-08-2020
09:35 AM
|
0
|
2
|
2585
|
|
POST
|
Hi Brian, Below is my test code. I am not running within QueuedTask.Run, but i will try that shortly. Strangely enough i got the exception once as well, but i was not able to duplicate the error after that. i am still investigating that issue. The code snippet is taken from the OnClick of a button i added to my test add-in. protected override void OnClick()
{
try
{
var map = MapView.Active.Map;
foreach (Layer layer in map.GetLayersAsFlattenedList().OfType<FeatureLayer>())
{
//var currentLayer = map.FindLayers(layer.Name).FirstOrDefault() as BasicFeatureLayer;
var currentLayer = layer as BasicFeatureLayer;
System.Diagnostics.Debug.WriteLine($@"Name: {currentLayer.Name} Type: {currentLayer.GetType()} Connect status: {currentLayer.ConnectionStatus}");
}
}
catch (Exception ex)
{
MessageBox.Show($@"Exception: {ex}");
}
}
... View more
12-08-2020
08:41 AM
|
0
|
2
|
3551
|
|
POST
|
Just to clarify: if you create an new add-in module on your dev machine using the ArcGIS Pro SDK project templates you will not get any broken references, because the Pro SDK is using the install location of ArcGIS Pro for its references. You will only see broken references if you uninstall ArcGIS Pro and then re-install to a different installation root folder.
... View more
12-07-2020
06:49 AM
|
0
|
0
|
3512
|
|
POST
|
Sorry for the late reply ... i just tried this using 2.6 and it worked fine. My sample code has the UriKind.Absolute parameter added in the Uri constructor. Let me know if you still have problems with this and i try it in 2.5. try
{
var workspaceConnectionString = await QueuedTask.Run(() =>
{
var sdePath = @"\\tsclient\C\Data\FeatureTest\sde-test.sde";
var dbGdbConnection = new DatabaseConnectionFile(new Uri(sdePath, UriKind.Absolute));
return new Geodatabase(dbGdbConnection).GetConnectionString();
});
MessageBox.Show(workspaceConnectionString);
}
catch (Exception ex)
{
MessageBox.Show($@"Error: {ex}");
}
... View more
12-04-2020
04:34 PM
|
0
|
0
|
2873
|
|
POST
|
If you are just getting started with Pro you can follow this Pro Guide here: ProGuide Build your first add in · Esri/arcgis-pro-sdk Wiki (github.com) It shows you how to first use a 'project template' in visual studio to create a Pro Module Add-in and then an 'Item template' to add a button to the add-in. When you add a button to your project, the button doesn't have any XAML associated with it, but you can add a 'Dockpane' Control in your sample and now you have the dockpane usercontrol with XAML (the view) and the MVVM viewmodel (code behind) file. We have this concept document: arcgis-pro-sdk wiki ProConcepts-Framework that will give you an overview of the Pro UI and how to integrate your own workflows. Also we have plenty of samples (including many MVVM samples) in our arcgis-pro-sdk-community-samples GitHub samples repo. Finally there's a ArcGIS Pro command line switch that allows you to see the complete (combined) DAML (and hence all add-ins that are loaded), so you can see what's actually included by Pro when it starts running. You can find information for this here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Command-line-switches-for-ArcGISPro.exe#view-the-daml-elements-loaded-at-startup
... View more
12-04-2020
12:04 PM
|
1
|
1
|
3528
|
|
POST
|
i tried it with 2.6.3 and it works fine. In my test i open the project and after the map is loaded i check the layers and none of them are null (i assume that the layer object in your code is null), even the one with the broken link. Are you processing the layer in some way before you run the 'broken' check ?
... View more
12-04-2020
11:35 AM
|
0
|
1
|
3587
|
|
POST
|
An empty Pro Add-in module does not contain XAML, so you must still have a bad add-in in your well-known addin folder that is getting loaded every time when Pro starts. Check the ArcGIS folder (under Documents) and delete all add-ins you still have in that folder. Then re-built your empty module (from you post above) and run it again. There shouldn't be any XAML binding / runtime errors, because the Module add-in doesn't contain any XAML. The screenshot above indicates that your data context is null, so you have to provide more information on how you got to that point. When adding items to an empty pro sdk add-in module please use the item templates because they ensure that the datacontext is set properly.
... View more
12-04-2020
10:19 AM
|
0
|
1
|
3531
|
|
POST
|
The Pro SDK provides some of the user controls that you are looking for here: ProConcepts Framework · Esri/arcgis-pro-sdk Wiki (github.com) For the standard controls (like listbox, etc.) you can use the style guide (you referenced above) to achieve a Pro look & feel. In addition we started to provide more complex Pro custom controls here: Map Authoring UI controls . We are adding more Pro user controls with each release.
... View more
12-04-2020
10:00 AM
|
0
|
0
|
846
|
|
POST
|
Hi Douglas, CIMSymbolReference.FromJson() can only de-serialize JSON that contains a CIMSymbolReference object. The message "Wrong type name" refers the type that has been serialized into your JSON string: {
"type": "CIMLineSymbol",
... If you look at the serialized JSON for a CIMSymbolReference you should see a JSON string looking like this: {
"type": "CIMSymbolReference",
"symbol": {
"type": "CIMPolygonSymbol",
"symbolLayers": [
{
"type": "CIMSolidStroke",
"enable": true,
"capStyle": "Round",
"joinStyle": "Round",
"lineStyle3D": "Strip",
"miterLimit": 10,
"width": 1,
"color": {
"type": "CIMRGBColor",
"values": [
0,
0,
0,
100
]
}
},
{
"type": "CIMSolidFill",
....
... View more
12-04-2020
09:42 AM
|
0
|
1
|
2658
|
| 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
|