private static ECSchema RetrieveSchema(DgnFile File, FindInstancesScope scope) { DgnECManager Manager = DgnECManager.Manager; DgnModel model = Session.Instance.GetActiveDgnModel(); var schemas = (List <string>)Manager.DiscoverSchemasForModel(model, ReferencedModelScopeOption.All, false); var schemaString = schemas.Where(x => x.Contains(schemaName)).FirstOrDefault(); if (schemaString != null) { try { IECSchema schema = Manager.LocateSchemaInScope(scope, schemaName, 1, 0, SchemaMatchType.Latest); return((ECSchema)schema); } catch (Exception e) { return(null); } } else { return(CreateSchema(File)); } }
public static List <string> RetrieveSchemas() { DgnECManager Manager = DgnECManager.Manager; DgnModel model = Session.Instance.GetActiveDgnModel(); return((List <string>)Manager.DiscoverSchemasForModel(model, ReferencedModelScopeOption.All, false)); }