CodePudding user response:
Declare a storage layer bai variableOpen the du graph database
Open the LayerTable
Traverse zhiLayerTable acquisition LayerTableRecord and join the LayerID variables to store the dao layer
Relevant layer are obtained from the Record information, such as the layer name, color, status, etc.
1
2
3
4
5
6
7
8
9
10
11.
12
13
14
15
16
17
18
19
///& lt; Summary>
///get the current graphics all layers in the
///& lt;/summary>
///& lt; Param name="db" & gt; A database object & lt;/param>
///& lt; Returns> Return a list of all the layers record & lt;/returns>
Public static List
{
//open the layer table
LayerTable lt=(LayerTable) db. LayerTableId. GetObject (OpenMode. ForRead);
//used to return a list of all layer table record
List
Foreach (ObjectId id in lt)//traverse layer table
{
//open the layer table record
LayerTableRecord LTR=(LayerTableRecord) id. GetObject (OpenMode. ForRead);
LTRS. Add (LTR);//add to the list of return
}
Return LTRS.//return a list of all the layers record
}
CodePudding user response:
https://blog.csdn.net/guo1wu3shi4/article/details/88786019