|
POST
|
There is a sample that shows how to dynamically join feature classes or tables: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins
... View more
10-05-2018
06:44 AM
|
0
|
0
|
1009
|
|
POST
|
We have a 'migration' write-up here: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-2.0-Migration-Guide Some of the API changes are documented here: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Migrating-to-2.0
... View more
10-02-2018
06:05 PM
|
0
|
0
|
960
|
|
POST
|
Here is a snippet that explains how to get the path: QueuedTask.Run(() =>
{
using (Geodatabase defaultGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(Project.Current.DefaultGeodatabasePath))))
{
FileGeodatabaseConnectionPath connectionPath = (FileGeodatabaseConnectionPath)defaultGeodatabase.GetConnector();
MessageBox.Show($@"Path: {connectionPath.Path}");
}
}); You can paste this into the OnClick of a button Add-in to test it out. Hope this helps, Wolf
... View more
09-19-2018
09:12 PM
|
1
|
0
|
740
|
|
POST
|
Hi Stephen, We have brought this issue to the attention of the Pro development team. In our observation there are some workflows in ArcGIS Pro (without any add-ins installed) that will produce the same problem you described, so it is actually not related to the API or the SDK. Hopefully the ArcGIS Pro development team can resolve this issue soon, however, it turns out that this exception (when thrown during shutdown as you described) can be safely ignored in your debugging session by using 'continue debug' or just stopping the debug session (which is what I usually do). Sorry about the inconvenience. - Wolf
... View more
09-12-2018
08:26 PM
|
0
|
1
|
3415
|
|
POST
|
Hi Fayu, You can use this code snippet: return QueuedTask.Run(() => {
var activeMapView = MapView.Active;
MapPoint zoomToPnt = MapPointBuilder.CreateMapPoint(coord.Longitude, coord.Latitude, SpatialReferences.WGS84);
var projectedXY = GeometryEngine.Instance.Project (zoomToPnt, activeMapView.Map.SpatialReference) as MapPoint;
}); There are multiple samples among the community samples that use projection, just search for "Instance.Project" on the community samples GitHub repo for a list of usages.
... View more
09-12-2018
02:36 PM
|
2
|
0
|
1143
|
|
POST
|
I usually use this snippet of code knowing that through a selection I get a dictionary with the MapMember as key and a list of object ids as the value for each MapMember. I am using a single mapmember and the corresponding objectId list as input for my sample method below (I am using similar code but this snippet is only pseudo code): // this in only pseudo code
// call from MCT
public RowCursor GetRowCursor(MapMember mapMember, List<long> objectIds)
{
var basicFeatLayer = mapMember as BasicFeatureLayer;
if (basicFeatLayer == null) return null;
// Create a query filter to fetch the appropriate rows for this mapmember
QueryFilter queryFilter = new QueryFilter()
{
ObjectIDs = objectIds
};
return basicFeatLayer.Search(queryFilter);
}
... View more
09-07-2018
02:00 PM
|
0
|
0
|
1693
|
|
POST
|
Hi Luke, You can look at this sample: OverlayExamples on how to construct line symbology and a 'graphic' object, and you can then use AddOverlayAsync to add the line to your MapView. Hope this helps. Wolf
... View more
09-07-2018
08:35 AM
|
1
|
1
|
1004
|
|
POST
|
Your snippet looks correct, see here. The error message unfortunately is not very descriptive as to the cause. So I would look at the input parameters, especially the path: sPrjDB + "\\Map\\Map.gdb\\Pipe" I would make sure that this path matches the path (and the feature class name) of the manually added layer. You can find the path by going to the content Dockpane, right-click on the feature layer, select properties, and then source.
... View more
08-24-2018
08:54 AM
|
0
|
1
|
4117
|
|
POST
|
Hi M, I think that your Camera is not properly initialized. A Camera requires more than just X and Y. Try to initialize your camera like this var newPosition = MapView.Active.Camera;
... View more
08-21-2018
04:35 PM
|
1
|
0
|
2642
|
|
POST
|
Hi Sree, You can take a look at this sample and see if it has what you need: AddInInfoManager It displays version information about add-ins - the 'Version' string is probably what you are looking for:
... View more
08-20-2018
11:30 PM
|
0
|
0
|
2618
|
|
POST
|
Hi Chao, I am not sure if you are looking for the actual 'datasource' of the Layer. If so: Layer inherits MapMember and you can use MapMember properties and methods to gain access to CIMDataConnection Once you have the CIMDataConnection you have to check what type of specific connection you are dealing with (i.e. CIMStandardDataConnection ) as shown this this Button 'OnClick' sample snippet: protected override void OnClick()
{
// Arbitrarily, pick the first feature layer - just assuming there is one!
var layer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().ToList()[0];
QueuedTask.Run(() =>
{
CIMDataConnection currentDataConnection = layer.GetDataConnection();
// check the specific type:
if (currentDataConnection is CIMStandardDataConnection)
{
var standardDC = currentDataConnection as CIMStandardDataConnection;
MessageBox.Show($@"WorkspaceConnectionString: {standardDC.WorkspaceConnectionString}
Dataset: {standardDC.Dataset}
DatasetType: {standardDC.DatasetType}");
}
});
} When I run this on my map (which geodatabase layers on the top), I get this output: with this Map:
... View more
08-16-2018
10:21 AM
|
1
|
1
|
1665
|
|
POST
|
You can take a look at the 'btnGetLayer_Click' Method in this community sample source file: arcgis-pro-sdk-community-samples/AddLayerDlg.xaml.cs at b76a6625dc3fa2e4287c1b39ab4b95e3a8f2b04b · Esri/arcgis-pro-sdk-c… In essence you want to use the "OpenItemDialog" class to browse for any geo data: ArcGIS Pro 2.2 API Reference Guide
... View more
08-15-2018
12:18 PM
|
0
|
1
|
1162
|
|
POST
|
If the API doesn't expose a method or property for your needs you can usually try the underlying 'Cartographic Information Model' (CIM) for that class. So specifically for the Map class you can find a BackgroundColor property in the corresponding CIMMap class. This code snippet will work for you: if (MapView.Active?.Map == null) return;
QueuedTask.Run(() =>
{
var cimMap = MapView.Active.Map.GetDefinition();
cimMap.BackgroundColor = CIMColor.CreateRGBColor(0, 0, 255, 138);
MapView.Active.Map.SetDefinition(cimMap);
}); Hope this helps.
... View more
08-14-2018
02:56 PM
|
0
|
1
|
6036
|
|
POST
|
Hi Daniel, This seems to be of 'common' interest, so I added sample code to cover some of the renders here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/GetSymbolSwatch
... View more
08-08-2018
05:17 PM
|
2
|
0
|
2151
|
|
POST
|
You can also go through your geodatabase using the geodatabase API first. In this case you can add your feature classes like this: // Add this in your OnClick code-behind for the button
if (MapView.Active?.Map == null) return;
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
// using the community sample dataset
using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"C:\Data\FeatureTest\FeatureTest.gdb"))))
{
using (FeatureClass addFeatureClass = geodatabase.OpenDataset<FeatureClass>("TestLines"))
{
LayerFactory.Instance.CreateFeatureLayer(addFeatureClass, MapView.Active.Map, 0, "New FC");
}
}
});
... View more
08-08-2018
09:03 AM
|
1
|
0
|
3161
|
| 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 |
03-30-2026
03:25 PM
|