IFClite TypeScript API
    Preparing search index...

    Interface IFCDataAccessor

    Interface for accessing IFC data during validation

    interface IFCDataAccessor {
        getAllEntityIds(): number[];
        getAncestors?(
            expressId: number,
            relationType: PartOfRelation,
        ): ParentInfo[];
        getAttribute(
            expressId: number,
            attributeName: string,
        ): string | number | boolean | undefined;
        getAttributeNames?(expressId: number): string[];
        getAttributeXsdTypes?(
            expressId: number,
            attrName: string,
        ): readonly string[] | undefined;
        getClassifications(expressId: number): ClassificationInfo[];
        getDescription(expressId: number): string | undefined;
        getEntitiesByType(typeName: string): number[];
        getEntityName(expressId: number): string | undefined;
        getEntityType(expressId: number): string | undefined;
        getGlobalId(expressId: number): string | undefined;
        getMaterials(expressId: number): MaterialInfo[];
        getObjectType(expressId: number): string | undefined;
        getParent(
            expressId: number,
            relationType: PartOfRelation,
        ): ParentInfo | undefined;
        getPredefinedTypeRaw?(expressId: number): string | undefined;
        getPropertySets(expressId: number): PropertySetInfo[];
        getPropertyValue(
            expressId: number,
            propertySetName: string,
            propertyName: string,
        ): PropertyValueResult | undefined;
        getSchemaVersion?(): string | undefined;
        getTypeEntityType?(expressId: number): string | undefined;
    }
    Index
    • Get all entity IDs

      Returns number[]

    • Walk every ancestor reachable via relationType (the IDS spec treats partOf as transitive — a wall in a storey in a building IS partOf the building). Optional: when not provided, the partOf facet falls back to single-step getParent traversal.

      Parameters

      Returns ParentInfo[]

    • Get attribute value by name

      Parameters

      • expressId: number
      • attributeName: string

      Returns string | number | boolean | undefined

    • Get the names of every attribute defined on the entity (its IFC schema-defined attribute names, including inherited ones). Used by the attribute-facet checker when the IDS uses a pattern or enumeration on <name> so the check can iterate every matching candidate, not just the small list of standard attribute names.

      Parameters

      • expressId: number

      Returns string[]

    • Get the XSD primitive types (xs:integer, xs:double, xs:string, xs:boolean, xs:date, xs:dateTime, xs:duration) that the IFC schema declares for the named attribute on the entity. The IDS validator uses this to enforce strict-cast semantics — an xs:integer-only slot rejects literals like 42.0, xs:double accepts both 42 and 42.0, etc. Returns undefined when the type is unknown so callers fall back to permissive comparison.

      Parameters

      • expressId: number
      • attrName: string

      Returns readonly string[] | undefined

    • Get entity description by express ID

      Parameters

      • expressId: number

      Returns string | undefined

    • Get all entity IDs of a specific type

      Parameters

      • typeName: string

      Returns number[]

    • Get entity name by express ID

      Parameters

      • expressId: number

      Returns string | undefined

    • Get entity type name by express ID

      Parameters

      • expressId: number

      Returns string | undefined

    • Get entity GlobalId by express ID

      Parameters

      • expressId: number

      Returns string | undefined

    • Get materials for an entity

      Parameters

      • expressId: number

      Returns MaterialInfo[]

    • The entity's predefined type as the IDS entity facet reads it - NOT the IFC ObjectType attribute (the attribute facet uses getAttribute). Per IDS 1.0 a USERDEFINED PredefinedType shifts the comparison to the user-defined name in ObjectType / ElementType; implementations MAY substitute that name here but MUST surface the raw enum via getPredefinedTypeRaw. Returns undefined when there is no predefined type: an unset or NOTDEFINED PredefinedType never falls back to ObjectType.

      Parameters

      • expressId: number

      Returns string | undefined

    • Get the raw PredefinedType enum token (e.g. USERDEFINED, NOTDEFINED, BEAM) without substitution to the user-defined name. Returns undefined when the entity has no predefined type.

      Parameters

      • expressId: number

      Returns string | undefined

    • Get property value

      Parameters

      • expressId: number
      • propertySetName: string
      • propertyName: string

      Returns PropertyValueResult | undefined

    • The model's raw IFC schema version string (e.g. IFC2X3, IFC4), when the accessor's backing store carries one. Used only for schema-scoped facet semantics — currently the IFC2X3 occurrence/type mapping table (facets/ifc2x3-type-mapping.ts).

      Returns string | undefined

    • The IFC entity class of the type object (IfcXxxType) this instance is related to via IfcRelDefinesByType, if any. Distinct from getPredefinedTypeRaw, which reads the type's PredefinedType value, not the type object's own entity class name — needed to resolve the IFC2X3 occurrence/type mapping table, where the alias is picked out by the TYPE's class, not its value.

      Parameters

      • expressId: number

      Returns string | undefined