We are in MicroStation Connect (latest) working with .NET api. (flexible)
We are trying to pull an ecschema from a reference model that is attached. We need to use the reference model in case the schema are not the same. We work through the DgnECManager API. We have been successful geting the schema names back using the DiscoverSchema methods. Our problem is when we try to use the LocateSchema calls we get a null back when we try to get the OpenPlant_3D (but it does work for the OpenPlant schema). Here is some of the calls we have been trying:
IEnumerable<string> currSchemaNames3 = dgnMgr.DiscoverSchemasForModel(currDgnModel, DPN.DgnEC.ReferencedModelScopeOption.None, false);
var dgnFileOpt = new DPN.DgnEC.FindInstancesScopeOption(DPN.DgnEC.DgnECHostType.Element |DPN.DgnEC.DgnECHostType.File, false);
var dgnFileScope = DPN.DgnEC.FindInstancesScope.CreateScope(currDgnFile, dgnFileOpt);
ECOS.IECSchema schemaStrict = dgnMgr.LocateSchemaInScope(dgnFileScope, "OpenPlant_3D", 1, 7, ECOS.SchemaMatchType.Exact);
ECOS.IECSchema schemaLoose = dgnMgr.LocateSchemaInScope(dgnFileScope, "OpenPlant_3D", 1, 7, ECOS.SchemaMatchType.LatestCompatible);
ECOS.IECSchema baseSchema = dgnMgr.LocateSchemaInScope(dgnFileScope, "OpenPlant", 1, 7, ECOS.SchemaMatchType.LatestCompatible);
ECOS.IECSchema modelSchema = dgnMgr.LocateSchema(currDgnConn,"OpenPlant_3D", 1, 7, ECOS.SchemaMatchType.LatestCompatible);
If we could get more documentation on these calls it would help :) We have been poking at various options here.
Hi Mark Anderson,
Can you try these suggestions and see if one or both produce more/desired results?
1. The model ref in question has no references. We have tried all the options as well.
2. We have also noticed that since the model is a v8i generation the item browser in Connect also has problems showing the schema information when the model is attached to another as a reference.