BIM.works SDKs - v3.0.0-b.115
    Preparing search index...

    A ModelManager keeps track of the models that have been loaded. A ModelManager is required when using the Viewer2d or Viewer3d. Most application will only need one ModelManager, but if you have an application where you want to show different models in different viewers, you might need more. The ModelManager keeps track of:

    Index

    Constructors

    Methods

    • Registers a listener for loaded, unloaded and swapped models

      Parameters

      • listener: ModelListener
      • OptionaltriggerForAllLoadedModels: boolean

        true: call listener.addModels with the models loaded already (the listener must have addModels then); what addModels returns is returned, a resolved Promise otherwise

      Returns void | Promise<unknown>

    • Add one or more models. The returned Promise will resolve after all connected components have performed the addModels call.

      Parameters

      Returns Promise<void>

      When a version lacks im_metadata (summary object, or geometry still processing). Use the complete Version as returned by @bimworks/jssdk!BimWorksClient.getNodeVersion.

      While a connected Viewer3d is in offline mode, the object data of an IFC model is read from the viewer's offline store instead of the server, and a model that was not prepared for offline use rejects with ModelNotAvailableOfflineError before any server call.

    • Parameters

      • ...types: string[]

      Returns QidSet

      All loaded objects except those of the given types

    • Parameters

      Returns Qid | null

      Get the Qid of the BuildingStorey of the given object (by Qid) or null if the object does not have a building storey

    • Parameters

      • buildingStoreyQid: Qid

      Returns QidSet | undefined

      The objects on a building storey. The returned object should not be changed.

    • Returns QidMap<unknown>

      The building storeys of the loaded models. The returned object should not be changed.

    • Parameters

      • OptionalversionUuids: string[]

      Returns QidSet

      The objects of the versions (default: all loaded) a viewer shows when they load: no spaces, zones, openings or building and storey boxes. A new set.

    • Get some information about a model, the model must already have been loaded

      Parameters

      • versionUuid: Qid

        The UUID of the Version

      Returns Model

    • Returns number

      The number of objects that are currently loaded

    • Parameters

      Returns ObjectInfo | undefined

      What the ModelManager knows about a loaded object, undefined for an unknown one. The returned object should not be changed.

    • Parameters

      • buildingStoreyQids: Iterable<Qid>
      • includeOpenings: boolean

      Returns QidSet

      A Set of Qid of the objects that belong to the given building storeys

    • Parameters

      Returns string | undefined

      The IFC type of a loaded object

    • Get all the @bimworks/jssdk!Qid s of the objects of the given (IFC) type

      Parameters

      • type: string

      Returns QidSet

    • Returns Set<string>

      The IFC types of the loaded objects

    • Parameters

      • versionUuid: string

      Returns Version | undefined

      The loaded @bimworks/jssdk!Version with this uuid, undefined when it is not loaded (or still loading)

    • Returns string[]

      An Array<@bimworks/jssdk!Vid with the @bimworks/jssdk!Vid of the currently loaded IFC models (no point clouds, drawings or glTF: what a query or a storey listing can be asked for)

    • Parameters

      Returns boolean

    • Parameters

      • versionUuid: string

      Returns boolean

    • hasObject for a version and oid, without making a Qid (members of a large group)

      Parameters

      • vid: string
      • oid: number

      Returns boolean

    • Hide the given models (must already be loaded)

      Parameters

      • versionUuids: string[]

      Returns Promise<void>

    • Return the inverse of a set of @bimworks/jssdk!Qid, so all the other loaded objects

      Parameters

      Returns QidSet

      A new QidSet with the Qid of every loaded object that qids does not contain

    • Parameters

      • qid: Qid
      • ...types: string[]

      Returns boolean

      Whether the object is of one of the types

    • Whether the object is a slab with predefined type ROOF, among the loaded models

      Parameters

      Returns boolean

    • Parameters

      • versionUuid: string

      Returns boolean

      Whether the given Version (by UUID) has been loaded

    • Puts one viewer ahead of another. The ModelManager hands new models to its viewers one at a time, in the order they were created; after this call high gets them before low, so the view in front loads first. Does nothing when either viewer is not attached to this ModelManager, or high is already first.

      Parameters

      Returns void

    • Parameters

      Returns void

    • Remove one or more models. The returned Promise will resolve after all connected components have performed the removeModels call.

      Parameters

      Returns Promise<void>

    • Lets go of an ObjectStateManager made on this ModelManager (its constructor registers it). Until then every model loaded later fills its sets: call it when the viewer the ObjectStateManager was made for goes

      Parameters

      Returns void

    • The client to load model data with, for a manager constructed before the client existed

      Parameters

      Returns void

    • Replace the existing set of loaded models, by the given set of models. This method will potentially unload models. The returned Promise will resolve after all connected components have performed the setModels call.

      Parameters

      Returns Promise<void>

    • Show the given models (must already be loaded)

      Parameters

      • versionUuids: string[]

      Returns Promise<void>

    • Returns number

      The number of loaded models

    • Replaces a loaded version by its successor (after a commit), keeping the object state of the objects that still exist. Falls back to unloading both and loading the new one when the swap cannot be done in place.

      Parameters

      • oldVersion: Version
      • newVersion: Version
      • OptionaldeletedOids: Iterable<number, any, any>

      Returns Promise<void>