diff --git a/src/bonsai/test/bim/feature/debug.feature b/src/bonsai/test/bim/feature/debug.feature index 6d0bb55bf9..b4de087ade 100644 --- a/src/bonsai/test/bim/feature/debug.feature +++ b/src/bonsai/test/bim/feature/debug.feature @@ -26,3 +26,9 @@ Scenario: Use the inspector - inspect from object When the object "IfcProject/My Project" is selected And I press "bim.inspect_from_object" Then nothing happens + +Scenario: Run IFC validation + Given an empty IFC project + And I load the demo construction library + And I press "bim.validate_ifc_file" + Then nothing happens diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index 6fd62f538d..f65c95077c 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -42,6 +42,7 @@ options: """ +from __future__ import annotations import os import sys import json @@ -50,7 +51,7 @@ import types import argparse from collections import namedtuple -from typing import Union, Any, Optional +from typing import Union, Any, Optional, TYPE_CHECKING from collections.abc import Iterator from logging import Logger, Handler @@ -60,11 +61,13 @@ else: EllipsisType = type(...) import ifcopenshell -import ifcopenshell.simple_spf import ifcopenshell.ifcopenshell_wrapper import ifcopenshell.ifcopenshell_wrapper as W import ifcopenshell.express.rule_executor +if TYPE_CHECKING: + import ifcopenshell.simple_spf + named_type = ifcopenshell.ifcopenshell_wrapper.named_type aggregation_type = ifcopenshell.ifcopenshell_wrapper.aggregation_type simple_type = ifcopenshell.ifcopenshell_wrapper.simple_type