IAnalysisModelQuery |
[This is preliminary documentation and is subject to change.]
See IAnalysisModelQuery for technical documentation
The IAnalysisModelQuery is a service that may be used to query an AnalysisModel
This service has various methods that help you query a model.
This page was last updated 2021-12-02
AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper(); using (IScopedServiceProvider scope = bootstrapper.CreateThreadedScope()) { IAnalysisModelQuery queryService = scope.GetService<IAnalysisModelQuery>(); }
AnalysisModel model = new AnalysisModel(); StructuralPointConnection nodeToCheck = model.OfType<StructuralPointConnection>().First(); AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper(); using (IScopedServiceProvider scope = bootstrapper.CreateThreadedScope()) { IAnalysisModelQuery queryService = scope.GetService<IAnalysisModelQuery>(); bool isReferencedByAnotherObject = queryService.IsReferencedByOtherObjects(model, nodeToCheck); }
AnalysisModel model = new AnalysisModel(); Guid someObjectId = Guid.NewGuid(); AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper(); using(IScopedServiceProvider scope = bootstrapper.CreateThreadedScope()) { IAnalysisModelQuery queryService = scope.GetService<IAnalysisModelQuery>(); IAnalysisObject objectWithMatchingId = queryService.GetById(model, someObjectId); }