IAnalysisModelItemDeleteService |
[This is preliminary documentation and is subject to change.]
See IAnalysisModelItemDeleteService for technical documentation
This service is primarily used to delete an item and its related items from an AnalysisModel
This page was last updated 2021-12-03
AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper(); using (IScopedServiceProvider scope = bootstrapper.CreateThreadedScope()) { IAnalysisModelItemDeleteService service = scope.GetService<IAnalysisModelItemDeleteService>(); }
AnalysisModel model = new AnalysisModel(); AnalysisDataModelBootstrapper bootstrapper = new AnalysisDataModelBootstrapper(); using(IScopedServiceProvider scope = bootstrapper.CreateThreadedScope()) { IAnalysisModelItemDeleteService service = scope.GetService<IAnalysisModelItemDeleteService>(); var beamToDelete = model.OfType<StructuralCurveMember>().FirstOrDefault(x => x.Name == "B23"); service.CascadingRemoveItemFromModel(model, beamToDelete); }
Note |
---|
Use this service with caution, as it might remove objects you were planning on using again at a later stage. The above example will produce the following result:
|