用途:在 Bonsai 中创建与管理 IFC 空间层级(IfcProject、IfcSite、IfcBuilding、IfcBuildingStorey、IfcSpace)及其聚合、包含与引用关系。
主要能力:通过 ifcopenshell.api.run 创建空间实体并连接层级;用 aggregate.assign_object 建立 IfcRelAggregates 父子关系;用 spatial.assign_container 将物理构件放入空间容器;用 spatial.reference_structure 处理跨楼层引用;用 spatial.unassign_container、spatial.dereference_structure 解除关系;用 ifcopenshell.util.element.get_container、get_decomposition、get_parts 查询;并提供 bpy.ops.bim.set_default_container、assign_container、remove_container、delete_container、copy_to_container、generate_space、generate_spaces_from_walls 等操作符。
必要用法:始终使用 bonsai.* 导入,禁止 blenderbim.*;空间元素必须通过层级连接;products 参数须传列表(products=[wall]);不得删除 IfcProject;创建元素前先设置默认容器;一个元素只能被一个空间结构包含,跨层用引用关系;创建空间实体用 root.create_entity,不用 model.create_entity()。
适用场景:在 Blender 中搭建 IFC 项目空间结构、放置构件到楼层或房间、生成 IfcSpace、查询空间归属。
限制:资料未提供收费、价格与平台信息;版本差异(IFC2X3/IFC4/IFC4X3)影响校验基类,IfcFacility 仅 IFC4X3 支持。