|
POST
|
If you have the dictionary as in: var selectionDictionary = new Dictionary<MapMember, List<long>>(); You can then use the static 'FromDictionary' method to create a selection set like this sample (from community samples) that uses a selection set to flash a set of corresponding features: await QueuedTask.Run(() =>
{
//Flash the collection of features.
var selectionSet = SelectionSet.FromDictionary(selectionDictionary);
mapView.FlashFeature(selectionSet);
}); Also there is a sample in the 3.0-Migration-Guide that you can find if you search for "SelectionSet" or "FromDictionary".
... View more
07-08-2022
11:35 AM
|
0
|
1
|
2756
|
|
POST
|
Using your XAML I made a 2.9 sample and then migrated the sample using the Pro Migration tool vsix: ProConcepts 3.0 Migration Guide · ArcGIS/arcgis-pro-sdk Wiki (github.com) I attached my sample project for your reference. The SuggestionSource property still exists, and my 3.0 add-in project compiled without error after the migration. You can't find the SuggestionSource property in the API reference guide because it is inherited from the ArcGIS.Desktop.Internal.Framework.Controls.SearchTextBox control and our online API reference guide always excluded such inherited "Internal" properties hence the property was not documented in the 2.x API reference guide. Such properties can be used in add-ins but are not supported by the Pro API regarding the API's 'forwards compatible across minor releases of Pro' support. My sample code implements an initial Suggestion list: and updates that list during runtime by clicking the button that adds feature layer names to the suggestion list.
... View more
07-08-2022
09:37 AM
|
1
|
2
|
1428
|
|
POST
|
I would recommend using a Dockpane instead of a ProWindow that works similar to the 'Locate' Dockpane in ArcGIS Pro: On the top of your search Dockpane i would show a drop down that allows the user to select the type of search they want to perform. Once the user selects the search method the fields specific to the search are displayed. After the search completes the found records are displayed in a list below the search query info just like on the ArcGIS Pro locate dockpane. There are plenty of community samples that do something similar. I attached a search sample dockpane that looks like this: However you implement this, i would avoid handing off the UI between different windows or dockpanes. If you have to implement any type of map manipulation (depending on the user's search option selection) do it within a QueuedTask.Run and await the action.
... View more
07-08-2022
02:40 AM
|
0
|
1
|
2651
|
|
POST
|
I think that Charlie has already addressed your issue, however, i just wanted to mention that you could also use a Layout Map Series in order to manipulate map frame extends for your layouts. Using a Map Series also allows you to apply map series specific properties that allow you to apply labelling specific to each map frame. There is a community sample available that does something similar: arcgis-pro-sdk-community-samples/Layouts/LayoutMapSeries at master · Esri/arcgis-pro-sdk-community-samples (github.com)
... View more
07-07-2022
09:14 AM
|
0
|
0
|
1049
|
|
POST
|
I used your sample code (with a different dataset) and it worked fine. Here's my code: private async void Test_Click(object sender, RoutedEventArgs e)
{
String layerName = "TestPoints";
var fLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(l => l.Name.Equals(layerName));
if (fLayer != null)
{
if (this.TbxPLUSCase.Text != null && this.TbxPLUSCase.Text != "")
{
Dictionary<long, string> RoadDict = new Dictionary<long, string>();
string whereClause = "TheString = '" + this.TbxPLUSCase.Text.ToUpper() + "'";
QueryFilter qf = new QueryFilter();
qf.WhereClause = whereClause;
var iCount = await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
var cnt = 0;
using (ArcGIS.Core.Data.Table PLUSTable = fLayer.GetTable())
{
using (RowCursor rowCursor = PLUSTable.Search(qf))
{
while (rowCursor.MoveNext())
{
using (ArcGIS.Core.Data.Row row = rowCursor.Current)
{
string dictvalue = row["TheString"].ToString();
long v = Convert.ToInt64(row.GetObjectID().ToString());
RoadDict[v] = dictvalue;
cnt++;
};
}
}
}
return cnt;
});
MessageBox.Show($@"Records found: {iCount}");
}
}
this.Close();
} You should be able to set a breakpoint inside the action for the QueuedTask.Run and step through the code. I suggest that you also add a try {} catch {} to get any exceptions that are thrown by your code (i.e. misspelled field names). This is what I saw with my sample code running:
... View more
07-07-2022
07:49 AM
|
0
|
0
|
2672
|
|
POST
|
What type of add-in extension project are you trying to add your Dockpane to? How did you create the project (i.e. created under 2.x and migrated to 3.0 or created under 3.0)?
... View more
07-07-2022
06:02 AM
|
0
|
0
|
719
|
|
POST
|
I used the community sample data for my code below, specifically the data in C:\Data\Admin\AdminData.gdb. Needless to say, i had to change the table names and field names. Here is the code for my sample button 'OnClick': protected override async void OnClick()
{
try
{
var MUResults = new Dictionary<string, List<string>>();
var gdbFolder = @"C:\Data\Admin\AdminData.gdb";
var gdbPath = new FileGeodatabaseConnectionPath(new Uri(gdbFolder));
await QueuedTask.Run(() =>
{
using (Geodatabase geodatabase = new Geodatabase(gdbPath))
{
QueryDef queryDef = new QueryDef
{
Tables = "PopulationByCounty",
SubFields = "OBJECTID, NAME, POP"
};
QueryTableDescription queryTableDescription = new QueryTableDescription(queryDef)
{
Name = "PopulationByCounty",
PrimaryKeys = geodatabase.GetSQLSyntax().QualifyColumnName("PopulationByCounty", "NAME")
};
Table queryTable = geodatabase.OpenQueryTable(queryTableDescription);
using (RowCursor rowCursor = queryTable.Search())
{
while (rowCursor.MoveNext())
{
using (var row = rowCursor.Current)
{
var county = row["NAME"].ToString();
var mukey = row["POP"].ToString();
if (MUResults.ContainsKey(county))
MUResults[county].Add(mukey);
else
MUResults.Add(county, new List<string>() { mukey });
}
}
}
}
});
foreach (var county in MUResults.Keys)
{
System.Diagnostics.Trace.WriteLine($@"County: {county}");
foreach (var mukey in MUResults[county])
{
System.Diagnostics.Trace.WriteLine($@" MUKEY - {mukey}");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} And here some of the content (as output by my sample) for the dictionary: County: Autauga County, Alabama MUKEY - 54597 MUKEY - 54773 MUKEY - 54893 MUKEY - 55869 County: Baldwin County, Alabama MUKEY - 182265 MUKEY - 183112 MUKEY - 199183 MUKEY - 223234 County: Barbour County, Alabama MUKEY - 27455 MUKEY - 27327 MUKEY - 26755 MUKEY - 24686 County: Bibb County, Alabama MUKEY - 22915 MUKEY - 22870 MUKEY - 22553 MUKEY - 22394
... View more
01-26-2022
12:17 PM
|
0
|
0
|
1933
|
|
POST
|
@Aashis is correct your 'where' clause is not properly constructed. I think your intend was to construct a where clause using the 'in' clause, for example: mukey in (100, 101, 205) The 'in' clause allows you to specify a list of possible matches. Depending on the datatype of mukey you might have to surround the 'in' clause items in single quotes. Here is a sample that worked for me: protected override void OnClick()
{
var mukeys = new List<string>();
mukeys.Add("Test 1");
mukeys.Add("Test 3");
var inClause = string.Join("','", mukeys.Select(i => i.Replace("'", "''")));
_ = QueuedTask.Run(() =>
{
QueryDef queryDef = new QueryDef
{
Tables = "testlines",
WhereClause = $@"description in ('{inClause}')",
SubFields = "objectid,description"
};
System.Diagnostics.Trace.WriteLine($@"Where: {queryDef.WhereClause}");
var defaultGdb = new FileGeodatabaseConnectionPath(new Uri(CoreModule.CurrentProject.DefaultGeodatabasePath));
using (Geodatabase geodatabase = new Geodatabase(defaultGdb))
{
QueryTableDescription queryTableDescription = new QueryTableDescription(queryDef)
{
Name = "testlines",
PrimaryKeys = geodatabase.GetSQLSyntax().QualifyColumnName("testlines", "objectid")
};
using (var queryTable = geodatabase.OpenQueryTable(queryTableDescription))
{
using (var cursor = queryTable.Search ())
{
while (cursor.MoveNext())
{
using (var row = cursor.Current)
{
System.Diagnostics.Trace.WriteLine($@"Found: {row["objectid"]} {row["description"]}");
}
}
}
}
}
});
} The diagnostic output of this snippet looks like this: Where: description in ('Test 1','Test 3') Found: 9 Test 1 Found: 11 Test 3
... View more
01-25-2022
07:30 AM
|
0
|
0
|
1155
|
|
POST
|
As @GKmieliauskas mentioned you forgot to include the declaration for MUResults. With the correct declaration your code can work: var MUResults = new Dictionary<string, List<string>>();
MUResults.Add("County1", new List<string>() { "First Item for County 1" });
if (MUResults.ContainsKey("County1")) {
MUResults["County1"].Add("Second Item for County 1");
}
... View more
12-08-2021
06:37 AM
|
0
|
2
|
2011
|
|
POST
|
You can cast your MULayer to the type BasicFeatureLayer and then use the GetDataConnection method to get the data connection properties: ArcGIS Pro 2.9 API Reference Guide - GetDataConnection Method—ArcGIS Pro GetDataConnection returns CIMDataConnection which can be directly used to create layers, standalone tables etc. in the same geodatabase. You can cast CIMDataConnection to CIMStandardDataConnection in order to view the detail about the connection, Here is a sample button: protected override void OnClick()
{
var TestLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<BasicFeatureLayer>().FirstOrDefault();
if (TestLayer == null) return;
QueuedTask.Run(() =>
{
var cimDataConnection = TestLayer.GetDataConnection() as CIMStandardDataConnection;
if (cimDataConnection == null) return;
System.Diagnostics.Trace.WriteLine(cimDataConnection.WorkspaceConnectionString);
});
} and the output for cimDataConnection.WorkspaceConnectionString in my sample is: DATABASE=C:\Data\Interacting with Maps\Interacting with Maps.gdb which in essence is the path to the file geodatabase.
... View more
12-07-2021
11:59 AM
|
0
|
0
|
2869
|
|
POST
|
I tested it too and it works. Looking at your daml it seems to me that your namespace doesn't match what you're using in your code. daml: defaultNamespace="GraphicsFireDeskAddInPro" doesn't match the code's namespace: namespace Rfmss.GraphicsFireDeskAddInPro
... View more
12-07-2021
11:25 AM
|
0
|
1
|
1543
|
|
POST
|
You can create a module add-in project, then add an ArcGIS Pro button in that project. By default the button will be on an add-in tab. Now you have to modify the content of the config.daml to insert your button into another tab, group, etc. This document gives an overview of DAML: ProConcepts Framework · Esri/arcgis-pro-sdk Wiki (github.com) here is a video: ArcGIS Pro SDK for .NET: Working With DAML - YouTube Also this sample modifies an existing ArcGIS Pro tab: arcgis-pro-sdk-community-samples/Framework/WorkingWithDAML at master · Esri/arcgis-pro-sdk-community-samples (github.com) Now you need to find the daml id for the version tab / group into which you need to add your button. To find the daml id you can use the 'Show command IDs' option in ArcGIS Pro: Or use the DAML ID reference: ArcGIS Pro DAML ID Reference · Esri/arcgis-pro-sdk Wiki (github.com)
... View more
11-19-2021
03:49 PM
|
0
|
2
|
1759
|
|
POST
|
I can't tell from your post if you are trying to use a Microsoft SQL Server database variant, but if you do and you are trying to use a fully qualified name to access tables (or fields), you have to use this format: form database.schema.object_name. Looking like this: select * from [ArcObjects].[dbo].[Image]; or select * from ArcObjects.dbo.Image; Consequently this syntax from your post will not work since it's missing the database schema: [database].table1
... View more
11-16-2021
07:57 AM
|
1
|
0
|
5541
|
|
POST
|
This can happen if your user control / viewmodel throws an exception on startup (look at the output of the debugger output window when you debug the addin). Or if you rename you user control and/or viewmodel. If you supply a sample project i can take a look at this, I am not aware of an issue in 2.8.
... View more
11-15-2021
11:05 AM
|
0
|
1
|
1226
|
|
POST
|
Glad you found a solution, sorry, my links pointed to a private repo, i fixed them.
... View more
11-08-2021
11:23 AM
|
0
|
0
|
3542
|
| 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
|