FindStandaloneTables Method (Map)
Finds StandaloneTables by name. Group layers within the map are also searched.
Parameters
- name
- The name of the StandaloneTable(s)
Return Value
A
IReadOnlyList of StandaloneTables with the matching name
Find edit template by name on a layer
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
//get the templates
var map = ArcGIS.Desktop.Mapping.MapView.Active.Map;
if (map == null)
return;
var mainTemplate = map.FindLayers("main").FirstOrDefault()?.GetTemplate("Distribution");
var mhTemplate = map.FindLayers("Manhole").FirstOrDefault()?.GetTemplate("Active");
});
Find table templates belonging to a standalone table
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
var map = ArcGIS.Desktop.Mapping.MapView.Active.Map;
if (map == null)
return;
//Get a particular table template
var tableTemplate = map.FindStandaloneTables("Address Points").FirstOrDefault()?.GetTemplate("Residences");
//Get all the templates of a standalone table
var ownersTableTemplates = map.FindStandaloneTables("Owners").FirstOrDefault()?.GetTemplates();
var statisticsTableTemplates = MapView.Active.Map.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 = aMap.FindStandaloneTable("CIMPATH=map/address_audit.xml");
IReadOnlyList<StandaloneTable> tables = aMap.FindStandaloneTables("addresses");
// this method finds a standalone table as a child of the map only
var table = aMap.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);
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.