IFClite TypeScript API
    Preparing search index...

    Function convertStepLine

    • Convert a raw STEP entity line from one schema version to another.

      Handles: 1. entity type names; 2. attribute counts (trim for older schemas, pad trailing $ for attributes a newer schema APPENDED, e.g. IFC4's PredefinedType on IfcWall); 3. entities with no target representation; 4. enum members the target lacks (enums, #5365).

      Parameters

      • line: string

        Raw STEP entity line (e.g., "#1=IFCWALL('guid',...);")

      • fromSchema: IfcSchemaVersion

        Source schema version

      • toSchema: IfcSchemaVersion

        Target schema version

      • Optionalrandom: RandomSource

        Optional seeded RandomSource for the GlobalId of any IFCPROXY placeholder minted here; pass one when output must be byte-reproducible.

      • Optionalslots: Ifc2x3SlotFill

        This package's exporters pass one; it carries the owner history they reuse (#4686) and collects what they could not settle. Omitted, a throwaway stands in, so the generated table's own defaults are still written but the OwnerHistory reuse and both counts are lost.

      • OptionalwithheldRefIds: ReadonlySet<number>

        Express ids this export is OMITTING outright (computeWithheldRefIds, #4206) — a record whose attributes name one is redirected to the same "no representation" resolution as its own unmapped type would get, so it cannot ship a now-dangling #N.

      • Optionalifc4Slots: Ifc4SlotCheck

        Counts IFC4-required slots left $ (IFC4X3/IFC5 → IFC4 only, #5202).

      • Optionalenums: EnumReconciliation

        Resolves enum members the target lacks and reports losses (#5365).

      Returns string | null

      Converted line (entities without valid target representation become IFCPROXY placeholders), or null when this record itself is one of the narrow set resolveUnrepresentedEntity can safely OMIT rather than throw for — the caller must not write a null result.