mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Validate entity is_abstract in ifcopenshell.geom.validate
This commit is contained in:
@@ -105,6 +105,13 @@ def validate(f, logger):
|
|||||||
|
|
||||||
entity = schema.declaration_by_name(inst.is_a())
|
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()):
|
for attr, val, is_derived in zip(entity.all_attributes(), inst, entity.derived()):
|
||||||
|
|
||||||
if val is None and not (is_derived or attr.optional()):
|
if val is None and not (is_derived or attr.optional()):
|
||||||
|
|||||||
Reference in New Issue
Block a user