From aa49db07d37a94606e54be15f4109819c7636664 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 27 Oct 2020 11:41:39 +0100 Subject: [PATCH] Validate entity is_abstract in ifcopenshell.geom.validate --- src/ifcopenshell-python/ifcopenshell/validate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index c47f916dc7..5a5801fc16 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -104,6 +104,13 @@ def validate(f, logger): logger.set_instance(inst) entity = schema.declaration_by_name(inst.is_a()) + + if entity.is_abstract(): + e = "Entity %s is abstract" % entity.name() + if hasattr(logger, 'set_instance'): + logger.error(e) + else: + logger.error('In {}\n{}'.format(inst, e)) for attr, val, is_derived in zip(entity.all_attributes(), inst, entity.derived()):