public static void Run(StepModel model)
        {
            var toDelete = Array.Empty <IPersistEntity>()
                           .Concat(model.Instances.OfType <IIfcRelDefinesByProperties>())
                           .Concat(model.Instances.OfType <IIfcPropertySetDefinition>())
                           .Concat(model.Instances.OfType <IIfcPropertyAbstraction>())
                           .ToArray();

            model.Delete(toDelete, true);
        }
        public void BatchDelete()
        {
            const string file = @"TestFiles\\4walls1floorSite.ifc";

            using (var model = new StepModel(ef2x3))
            {
                model.LoadStep21(file);

                var products = model.Instances.OfType <IfcProduct>().ToArray();

                var w = Stopwatch.StartNew();
                model.Delete(products, true);
                w.Stop();

                Console.WriteLine($"Deleted {products.Length} in {w.ElapsedMilliseconds}ms");

                var check = model.Instances.OfType <IfcProduct>().ToArray();
                Assert.AreEqual(0, check.Length);

                var propRels = model.Instances.OfType <IfcRelDefinesByProperties>();
                Assert.IsTrue(propRels.All(r => r.RelatedObjects.Count == 0));
            }
        }