That Open Engine | web-ifc
    Preparing search index...

    Class IfcAPI

    Index

    Constructors

    Properties

    properties: Properties = ...

    Contains all the logic and methods regarding properties, psets, qsets, etc.

    Methods

    • Closes a model and frees all related memory

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel, model must be closed after use

      Returns void

    • Creates a new ifc entity

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • type: number

        Type code

      • ...args: any[]

        Arguments required by the entity

      Returns IfcLineObject

      An object contining the parameters of the new entity

    • Creates a new ifc globally unqiue ID

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      Returns any

      An randomly generated globally unique ID

    • Creates a new ifc type i.e. IfcLabel, IfcReal, ...

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • type: number

        Type code

      • value: any

        Type value

      Returns any

      An object with the parameters of the type

    • Decodes test using IFC Encoding

      Parameters

      • text: string

      Returns any

      the text decoded

      the text to decode

    • Deletes an IFC line from the model

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressID: number

        express ID of the line to remove

      Returns void

    • Closes all models and frees all related memory. Please note that after calling this you must call Init() again to ensure web-ifc is in a working state.

      Returns void

    • Encodes test using IFC Encoding

      Parameters

      • text: string

      Returns any

      the text encoded

      the text to encode

    • Returns all alignments contained in the IFC model (IFC4x3 or superior)

      Parameters

      • modelID: number

        model ID

      Returns any

      Lists with horizontal and vertical curves as sets of points

    • Returns all crossSections in 2D contained in IFCSECTIONEDSOLID, IFCSECTIONEDSURFACE, IFCSECTIONEDSOLIDHORIZONTAL (IFC4x3 or superior)

      Parameters

      • modelID: number

        model ID

      Returns CrossSection[]

      Lists with the cross sections curves as sets of points

    • Returns all crossSections in 3D contained in IFCSECTIONEDSOLID, IFCSECTIONEDSURFACE, IFCSECTIONEDSOLIDHORIZONTAL (IFC4x3 or superior)

      Parameters

      • modelID: number

        model ID

      Returns CrossSection[]

      Lists with the cross sections curves as sets of points

    • Get all line IDs of a model

      Parameters

      • modelID: number

        model ID

      Returns Vector<number>

      vector of all line IDs

    • Gets the list of all ifcTypes contained in the model

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      Returns IfcType[]

      Array of objects containing typeID and typeName

    • Get the coordination matrix

      Parameters

      • modelID: number

        model ID

      Returns number[]

      flat 4x4 matrix as array[16]

    • Looks up an entities express ID from its GlobalID.

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • guid: string

        GobalID to be looked up

      Returns undefined | string | number

      expressID numerical value

    • Load geometry for a single element

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressID: number

        ExpressID of the element

      Returns FlatMesh

      FlatMesh object

    • Retrieves the geometry of an element

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • geometryExpressID: number

        express ID of the element

      Returns IfcGeometry

      Geometry of the element as a list of vertices and indices

    • Looks up an entities GlobalID from its ExpressID.

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressID: number

        express ID to be looked up

      Returns undefined | string | number

      globalID string value

    • Gets the header information required by the user

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • headerType: number

        Type of header data you want to retrieve ifc.FILE_NAME, ifc.FILE_DESCRIPTION or ifc.FILE_SCHEMA

      Returns any

      An object with parameters ID, type and arguments

    • Returns a list with all entity types that are present in the current schema

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      Returns number[]

      Array of type codes

    • Parameters

      • ptr: number
      • size: number

      Returns Uint32Array

    • Gets the ifc line data for a given express ID

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressID: number

        express ID of the line

      • flatten: boolean = false

        recursively flatten the line, default false

      • inverse: boolean = false

        get the inverse properties of the line, default false

      • inversePropKey: undefined | null | string = null

        filters out all other properties from a inverse search, for a increase in performance. Default null

      Returns any

      lineObject

    • Get all line IDs of a specific ifc type

      Parameters

      • modelID: number

        model ID

      • type: number

        ifc type,

      • includeInherited: boolean = false

        if true, also returns all inherited types

      Returns Vector<number>

      vector of line IDs

      IfcEntities

    • Gets the ifc line data for a given express ID

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressIDs: number[]
      • flatten: boolean = false

        recursively flatten the line, default false

      • inverse: boolean = false

        get the inverse properties of the line, default false

      • inversePropKey: undefined | null | string = null

        filters out all other properties from a inverse search, for a increase in performance. Default null

      Returns any[]

      lineObject

    • Returns the type of a given ifc entity in the fiule.

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressID: number

        Line Number

      Returns any

      IFC Type Code

    • Returns the maximum ExpressID value in the IFC file, ex.- #9999999

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      Returns number

      Express numerical value

    • Fetches the ifc schema version of a given model

      Parameters

      • modelID: number

        Model ID

      Returns string

      IFC Schema version

    • Gets the name from a type code

      Parameters

      • type: number

        Code

      Returns string

      Name

    • Gets the next unused expressID

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • expressID: number

        Starting expressID value

      Returns number

      The next unused expressID starting from the value provided

    • Parameters

      • heap: any
      • startPtr: number
      • sizeBytes: number

      Returns any

    • Gets the type code from a name code

      Parameters

      • typeName: string

      Returns number

      type code

    • Returns the version number of web-ifc

      Returns any

      The current version number as a string

    • Parameters

      • ptr: number
      • size: number

      Returns Float32Array

    • Initializes the WASM module (WebIFCWasm), required before using any other functionality.

      Parameters

      • OptionalcustomLocateFileHandler: LocateFileHandlerFn

        An optional locateFile function that let's you override the path from which the wasm module is loaded.

      • forceSingleThread: boolean = false

      Returns Promise<void>

    • Evaluates if a type is subtype of IfcElement

      Parameters

      • type: number

        Type code

      Returns boolean

      True if subtype of Ifcelement, False if it is not subtype

    • Checks if a specific model ID is open or closed

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      Returns boolean

      true if model is open, false if model is closed

    • Opens a model and returns a modelID number

      Parameters

      • data: Uint8Array

        Buffer containing IFC data (bytes)

      • Optionalsettings: LoaderSettings

        Settings for loading the model

      Returns number

      ModelID or -1 if model fails to open

      LoaderSettings

    • Opens a model and returns a modelID number

      Parameters

      • callback: ModelLoadCallback

        a function of signature (offset:number, size: number) => Uint8Array that will retrieve the IFC data

      • Optionalsettings: LoaderSettings

        Settings for loading the model

      Returns number

      ModelID or -1 if model fails to open

      LoaderSettings

    • Opens a set of models and returns model IDs

      Parameters

      • dataSets: Uint8Array<ArrayBufferLike>[]

        Array of Buffers containing IFC data (bytes)

      • Optionalsettings: LoaderSettings

        Settings for loading the model

      Returns number[]

      Array of model IDs

      LoaderSettings

    • Resets the Cached IFC Data - useful when changing the geometry of a model

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      Returns any

    • Saves a model to a Buffer

      Parameters

      • modelID: number

        Model ID

      Returns Uint8Array

      Buffer containing the model data

    • Set the transformation matrix

      Parameters

      • modelID: number

        model ID

      • transformationMatrix: number[]

        transformation matrix, flat 4x4 matrix as array[16]

      Returns void

    • Sets the path to the wasm file

      Parameters

      • path: string

        path to the wasm file

      • absolute: boolean = false

        if true, path is absolute, otherwise it is relative to executing script

      Returns void

    • Streams all meshes of a model

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • meshCallback: (mesh: FlatMesh, index: number, total: number) => void

        callback function that is called for each mesh

      Returns void

    • Streams all meshes of a model with a specific ifc type

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • types: number[]

        types of elements to stream

      • meshCallback: (mesh: FlatMesh, index: number, total: number) => void

        callback function that is called for each mesh

      Returns void

    • Streams meshes of a model with specific express id

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel *

      • expressIDs: number[]

        expressIDs of elements to stream

      • meshCallback: (mesh: FlatMesh, index: number, total: number) => void

        callback function that is called for each mesh

      Returns void

    • Writes a set of line to the model, can be used to write new lines or to update existing lines

      Type Parameters

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • lineObject: Type

        line object to write

      Returns void

    • Writes a line to the model, can be used to write new lines or to update existing lines

      Type Parameters

      Parameters

      • modelID: number

        Model handle retrieved by OpenModel

      • lineObjects: Type[]

      Returns void