ORD | 2021 release 2 update 10 | 10.10.21.04In Ord, each element has a feature definition. Is there a way to get the feature definition for each element?I have a list of IDgnECInstance. I need to get their feature definition and descriptionmore code:
public IEnumerable<Instance> Scan(string schemaName) { var instances = GetInstances(GetSearchClasses(schemaName)); foreach (var instance in instances) { yield return new Instance() { ElementId = instance.Element.ElementId.ToString(), ClassDefinitionDisplayLabel = instance.ClassDefinition.DisplayLabel, FeatureDefinition = instance.Element.FeatureDefinition // this field doesn`t exist }; } } private IQueryable<IDgnECInstance> GetInstances(IECClass[] classes) { var query = new ECQuery(classes) { SelectClause = { SelectAllProperties = true } }; var manager = DgnECManager.Manager; var scopeOptions = new FindInstancesScopeOption(DgnECHostType.Element, true); var dgnFile = _dgnFileProvider.GetActiveDgnFile(); if (dgnFile == null) return null; var scope = FindInstancesScope.CreateScope(dgnFile, scopeOptions); var instances = manager.FindInstances(scope, query); return instances.AsQueryable(); } private IECClass[] GetSearchClasses(string schemaName) { var scopeOptions = new FindInstancesScopeOption(DgnECHostType.All, true); var scope = FindInstancesScope.CreateScope(Session.Instance.GetActiveDgnFile(), scopeOptions); return DgnECManager.Manager.LocateSchemaInScope(scope, schemaName, 1,0,SchemaMatchType.Latest).GetClasses(); }
Robert Hook said:each of those insight links still work and point to the latest topics and software versions available
Thanks for the reminder!
The EC Class Editor is delivered with certain OpenPlant products...
Regards, Jon Summers LA Solutions
Hi Jon Summers,
Jon Summers said:Unfortunately, the ECSchema Editor is not a permanent member of Bentley's Software Downloads. Perhaps Robert Hook can tell us more about the ECSchema Editor and its availability?
Interesting timing of the question...As of one year ago tomorrow (11/29/2021), I provided a High-level overview topic for "Class Editors" (anchor) that (still to the best of my knowledge) provides the best insights and most current options I could find and share. I validated (today) that each of those insight links still work and point to the latest topics and software versions available.
Thank you and HTH,Bob
LINQ is a very good and compact way to provide an example. I do not understand why you are reacting to this in this thread - this is not the subject of our discussion. Idle talk, sorry!
Jan Ĺ legr said:t looks funny a bit when you are
Mark Shamoun said:If you are only after the Feature Definition names you could simply...
Examine the ORD schema files! However, Jan comments that the overall schema is rather complex. XML files are plain text, but their content is rather indigestible. One way to clarify their content is to examine them using Bentley's ECSchema Editor.
Unfortunately, the ECSchema Editor is not a permanent member of Bentley's Software Downloads. Perhaps can tell us more about the ECSchema Editor and its availability?
Hi Ivan,
If you are only after the Feature Definition names you could simply use an interop Property Handle method to get the "ObjectSettings" property value for each element (or use VBA).
Regards,
Mark
OpenRoads Designer 2022 R3 (10.12) | Microstation 2023.1 | ProjectWise CE 3.4