用途:校验 IFC 文件的模式(schema)合规性、IDS(Information Delivery Specification)符合性以及自定义质量规则,避免只检查模式有效性而漏掉项目信息要求。
主要能力:ifcopenshell.validate.validate() 提供基本类型/属性检查,可选 EXPRESS WHERE 规则;validate_guid、validate_ifc_header 分别校验 GUID 与文件头;ifctester 用于 IDS 校验,并支持 Console/Json/Html/Bcf/Ods/Txt 报告输出;georeference.* API 处理地理参考(IFC4+)。
必要用法:校验时必须传入配置好的 logging.Logger,结果通过日志而非返回值或异常输出;用 LogDetectionHandler 或 json_logger 程序化判定通过/失败。先用基本模式(默认 express_rules=False),不要首次即开启 EXPRESS WHERE 规则。IDS 校验用 ifctester.open 加载规范后调用 ids.validate(ifc_file)。命令行:python -m ifcopenshell.validate model.ifc(可加 --rules/--json/--fields),python -m ifctester model.ifc requirements.ids(--reporter Html --output report.html)。
限制与注意:模式校验与 IDS 校验不可混淆;IFC2X3 与 IFC4+ 地理参考机制不同,IfcMapConversionScaled 仅 IFC4X3 可用;地理参考参数须由测量方确认。自定义规则需自行编写 Python 遍历逻辑。