Click or drag to resize

IStructuralAnalysisModelQuery

[This is preliminary documentation and is subject to change.]

See IStructuralAnalysisModelQuery for technical documentation

This service allows you to query a model for objects using the type of object

This page was last updated 2021-12-03

Examples
Retrieve the service from the container
AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper();

using (IScopedServiceProvider scope = bootstrapper.CreateThreadedScope())
{
  IStructuralAnalysisModelQuery queryService = scope.GetService<IStructuralAnalysisModelQuery>();
}
Retrieve objects of a certain type from a model
AnalysisModel model = new AnalysisModel();
AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper();

using (IScopedServiceProvider scope = bootstrapper.CreateThreadedScope())
{
  IStructuralAnalysisModelQuery queryService = scope.GetService<IStructuralAnalysisModelQuery>();
  IReadOnlyList<StructuralCrossSection> crossSections = queryService.OfType<StructuralCrossSection>(model);
}
Retrieve an object of a certain type with a certain name from a model
AnalysisModel model = new AnalysisModel();
AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper();

using (IScopedServiceProvider scope = bootstrapper.CreateThreadedScope())
{
  IStructuralAnalysisModelQuery queryService = scope.GetService<IStructuralAnalysisModelQuery>();
  IReadOnlyList<StructuralCrossSection> crossSections = queryService.OfTypeWithName<StructuralCrossSection>(model, "CS21);
}
See Also