FindStandaloneTables Method (Map)
In This Topic
Finds StandaloneTables by name. Group layers within the map are also searched.
Syntax
Parameters
- name
- The name of the StandaloneTable(s)
Return Value
A
IReadOnlyList of StandaloneTables with the matching name
Example
Find edit template by name on a layer
// Finds and retrieves specific editing templates by name from layers in the active map.
await QueuedTask.Run(() =>
{
var mainTemplate = activeMap.FindLayers("main").FirstOrDefault()?.GetTemplate("Distribution");
var mhTemplate = activeMap.FindLayers("Manhole").FirstOrDefault()?.GetTemplate("Active");
});
Find table templates belonging to a standalone table
// retrieve editing templates associated with standalone tables in the active map.
await QueuedTask.Run(() =>
{
//Get a particular table template
var tableTemplate = activeMap.FindStandaloneTables("Address Points").FirstOrDefault()?.GetTemplate("Residences");
//Get all the templates of a standalone table
var ownersTableTemplates = activeMap.FindStandaloneTables("Owners").FirstOrDefault()?.GetTemplates();
var statisticsTableTemplates = activeMap.GetStandaloneTablesAsFlattenedList().First(l => l.Name.Equals("Trading Statistics")).GetTemplates();
});
Find a standalone table
{
// these routines find a standalone table whether it is a child of the Map or a GroupLayer
var tblFind = map.FindStandaloneTable("CIMPATH=map/address_audit.xml");
IReadOnlyList<StandaloneTable> tables = map.FindStandaloneTables("addresses");
// this method finds a standalone table as a child of the map only
var table = map.StandaloneTables.FirstOrDefault(t => t.Name == "Addresses");
}
Retrieve a table from its container
{
var container = MapView.Active.Map;
//the map standalone table collection
var table = container.GetStandaloneTablesAsFlattenedList()
.FirstOrDefault(tbl => tbl.Name == "EarthquakeDamage");
//or from a group layer
var grp_layer = MapView.Active.Map.FindLayers("GroupLayer1").First() as GroupLayer;
var table2 = grp_layer.FindStandaloneTables("EarthquakeDamage").First();
//or grp_layer.GetStandaloneTablesAsFlattenedList().First()
//or grp_layer.StandaloneTables.Where(...).First(), etc.
//show the table in a table view
//use FrameworkApplication.Current.Dispatcher.BeginInvoke if not on the UI thread
FrameworkApplication.Panes.OpenTablePane(table2);
}
Requirements
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)
ArcGIS Pro version: 3.0 or higher.
See Also