示例#1
0
 /// <summary>
 /// Gets layer ID by name
 /// </summary>
 /// <param name="layerName">The layer name.</param>
 /// <param name="mark"> 如果没找到 是否新建 </param>
 /// <returns>The layer ID.</returns>
 public static ObjectId GetLayerByName(string layerName, bool mark = false)
 {
     if (mark)
     {
         return(GoatDB.GetSymbolTableRecord(GoatDB.db.LayerTableId, layerName, () => new LayerTableRecord {
             Name = layerName
         }));
     }
     return(GoatDB.GetSymbolTableRecord(GoatDB.db.LayerTableId, layerName));
 }
示例#2
0
 // 获取所有图层名称
 public static string[] GetAllLayerNames()
 {
     return(GoatDB.GetSymbolTableRecordNames(GoatDB.db.LayerTableId));
 }
示例#3
0
 public static T[] QOpenForRead <T>(this IEnumerable <ObjectId> ids)  where T : DBObject
 {
     using (var trans = GoatDB.GetDatabase(ids).TransactionManager.StartTransaction()) {
         return(ids.Select(id => trans.GetObject(id, OpenMode.ForRead) as T).ToArray());
     }
 }