SuperAPI AI 工具集

ifc-syntax-classifications

编程与开发

查看项目

更新于 10-16 11:57

技能介绍

IFC Syntax : Classifications 技能面向在 IFC 模型中处理分类编码与外部库引用的场景。它说明 IFC 模型通过一组固定实体,把对象链接到外部分类系统(Uniclass、OmniClass、MasterFormat、ETIM)以及外部库。该技能覆盖这些实体、承载实际编码的属性,以及会在往返文件时导致问题的 IFC2x3 / IFC4 / IFC4.3 版本差异。适用范围为 IFC2x3、IFC4 和 IFC4.3。

主要实体结构:

  • IfcClassification:分类体系本身(例如整个 Uniclass 2015),包含发布方、版本和名称;在 IFC4 与 IFC4.3 中是 IfcExternalInformation 的子类型。Name 是唯一必需属性。Specification 是体系的 URI/URN/URL 定位符(IFC4 中该属性名为 Location)。ReferenceTokens 列出复合编码内的分面分隔标记,便于读取方把 EF_25_10_25 拆成多个分面。不得把 IfcClassification 直接当作编码附加到元素上。
  • IfcClassificationReference:体系中的一个具体编码,是 IfcExternalReference 的子类型,编码字符串来自继承属性 Identification(IFC2x3 中名为 ItemReference);Name 是可读标题,不是编码。ReferencedSource 可指向 IfcClassification 体系,也可指向父级 IfcClassificationReference,从而构建层级分类树。
  • IfcRelAssociatesClassification:对象化关系,把分类绑定到对象,父类型链为 IfcRoot > IfcRelationship > IfcRelAssociates > IfcRelAssociatesClassification。RelatedObjects 为被分类的对象或对象类型;RelatingClassification 为 IfcClassificationReference(编码)或整个 IfcClassification(体系)。同一编码应复用一个关系覆盖多个对象,不应逐对象创建关系。

外部库引用采用结构相同的机制:IfcRelAssociatesLibrary(RelatingLibrary 为 IfcLibrarySelect)、IfcLibraryReference(库中的单个条目,继承 Identification)、IfcLibraryInformation(库整体元数据)。外部规格或产品数据表应使用库实体,而不是强行归入分类实体。

常见外部分类体系包括:Uniclass 2015(英国,分面/表格式,示例编码 EF_25_10_25)、OmniClass(北美,多表,如 Table 21 / Table 23 编码)、MasterFormat(北美,规格编号,如 04 20 00)、ETIM(欧洲,技术产品类,如 EC000123)。

版本差异(简表):IfcClassification 的父类型在 IFC2x3 无、IFC4/IFC4.3 为 IfcExternalInformation;体系 URI 属性在 IFC2x3 缺失、IFC4 为 Location、IFC4.3 为 Specification;Description / ReferenceTokens 在 IFC2x3 缺失、IFC4/IFC4.3 存在;引用上的编码属性在 IFC2x3 为 ItemReference,IFC4/IFC4.3 为 Identification;IfcExternalReference.Location 类型在 IFC2x3 为 IfcLabel,IFC4/IFC4.3 为 IfcURIReference;IfcClassificationReference.ReferencedSource 类型在 IFC2x3 为 IfcClassification,IFC4/IFC4.3 为 IfcClassificationReferenceSelect;IfcRelAssociatesClassification.RelatingClassification 类型在 IFC2x3 为 IfcClassificationNotationSelect,IFC4/IFC4.3 为 IfcClassificationSelect;层级树机制在 IFC2x3 使用 IfcClassificationItem 树,IFC4/IFC4.3 使用嵌套 IfcClassificationReference。

决策要点:建整个体系用 IfcClassification(设置 Name,IFC4.3 设置 Specification 或 IFC4 设置 Location 为体系 URI);建单个编码用 IfcClassificationReference(编码写入 Identification 或 ItemReference,ReferencedSource 指向体系);绑定编码或体系到对象用 IfcRelAssociatesClassification;外部规格、数据表或产品库条目用 IfcLibraryReference + IfcLibraryInformation,并由 IfcRelAssociatesLibrary 绑定。编码是否嵌套:单编码无父级时 ReferencedSource 指向 IfcClassification;IFC4/IFC4.3 的子编码可指向父级引用以形成嵌套;IFC2x3 不能用 IfcClassificationReference 嵌套,需用 IfcClassificationItem。

使用模式:分类包含三个实体——一个 IfcClassification(体系)、每个不同编码一个 IfcClassificationReference、一个 IfcRelAssociatesClassification 把该引用链接到所有携带该编码的对象;同一编码的对象应列入单个关系的 RelatedObjects 集合。若某类型的全部实例共享编码,应分类类型对象(如 IfcWallType);仅当个别元素偏离类型时才分类实例(IfcWall)。体系 URI 在 IFC4.3 写 Specification、IFC4 写 Location,用错属性名会产生未知属性错误;编码在 IFC4/IFC4.3 用 Identification、IFC2x3 用 ItemReference;不得把 IFC2x3 的 IfcClassification 实例原样复制到 IFC4 文件。

参考资源:references/methods.md 提供 IFC2x3、IFC4、IFC4.3 的完整已验证实体定义、各类 select 类型及继承属性;references/examples.md 提供 STEP 场景示例(Uniclass 体系与编码、多墙共享关系、嵌套编码树、IFC2x3 分类、库引用);references/anti-patterns.md 列出了该技能防止的失败模式及原因。官方来源包括 buildingsmart 的 IFC4.3、IFC4 与 IFC2x3 词法文档页面。相关技能有 ifc-core-relationships、ifc-impl-data-enrichment、ifc-impl-version-migration。