Hi,
I have this simple test code:
DgnFile file = Session.Instance.GetActiveDgnModel().GetDgnFile(); FindInstancesScopeOption designLinkScopeOption = new FindInstancesScopeOption(DgnECHostType.DesignLink, false); FindInstancesScope scope = FindInstancesScope.CreateScope(file, designLinkScopeOption); IECSchema designLinksSchema = DgnECManager.Manager.LocateDeliveredSchema("BentleyDesignLinksPresentation", 1, 0, SchemaMatchType.LatestCompatible, file); List<SearchClass> searchClasses = new List<SearchClass>(); searchClasses.Add(new SearchClass(designLinksSchema["URLLinkProperties"], false)); searchClasses.Add(new SearchClass(designLinksSchema["ModelLinkProperties"], false)); ECQuery query = new ECQuery(searchClasses); query.SelectClause.SelectAllProperties = true; DgnECInstanceCollection ecInstances = DgnECManager.Manager.FindInstances(scope, query);
I would expect DgnECInstanceCollection instance contains only the specified EC classes (representing DesignLinks created by a user), but for every DesignLink class also another LinkTreeProperties class exists in the result.
It's not a big issue, because classes can be filtered easily later ...
var result = from r in ecInstances where r.ClassDefinition.Name.Equals("ModelLinkProperties", System.StringComparison.Ordinal) || r.ClassDefinition.Name.Equals("URLLinkProperties", System.StringComparison.Ordinal) select r;
... but I would like to understand API better:
With regards,
Jan
Thanks for the confirmation :-)
Regards,
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:... or it's a bug?
That one.
Answer Verified By: Jan Šlegr