示例#1
0
        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));
            }
        }
示例#2
0
            public static List <string> RetrieveSchemas()
            {
                DgnECManager Manager = DgnECManager.Manager;
                DgnModel     model   = Session.Instance.GetActiveDgnModel();

                return((List <string>)Manager.DiscoverSchemasForModel(model, ReferencedModelScopeOption.All, false));
            }