BIM.works SDKs - v1.5.0-b164
    Preparing search index...

    QidSet represents a Set of Qid. The main reasons why this class exists and should be used are:

    • A regular Set can not handle custom objects such as Qid
    • The internal implementation of QidSet is a lot more efficient than a generic Set object (it can do so because it is aware of what type is stored)

    This object is Set-like (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects)

    The methods on this class are also as much as possible identical to that of the built-in Set class.

    Index

    Constructors

    Accessors

    • get first(): Qid

      Returns Qid

      The first Qid in this QidSet. Keep in mind that order in a QidSet is not guaranteed thus this method really should only be used in cases where the QidSet is of size 1

    Methods

    • Add a Qid to this set

      Parameters

      • qid: Qid

        The Qid to add

      Returns boolean

      Whether the Qid was added, only returns false when the Qid was already in the set

    • Add all the Qids of the given QidSet to this QidSet

      Parameters

      Returns number

      The number of Qids that were added (already existing ones not counted)

    • Add a Qid to this set. This method does the same thing as the add(qid) method but can be slightly more efficient in cases where no Qid is available

      Parameters

      • vid: string

        The Vid (Version UUID)

      • oid: number

        The Oid (Object ID)

      Returns boolean

      Whether the Qid was added, only returns false when the Qid was already in the set

    • Remove a Qid from this QidSet

      Parameters

      • qid: Qid

        The Qid to remove

      Returns boolean

      Whether the Qid was removed, returns false when the Qid did not exist in the QidSet

    • The difference() method of QidSet instances takes a QidSet and returns a new QidSet containing elements in this QidSet but not in the given QidSet.

      Parameters

      • other: QidSet

        The other QidSet to subtract

      Returns QidSet

    • The entries() method of QidSet instances returns a new set iterator object that contains an array of [qid, qid] for each element in this set. For QidSet objects there is no key like in QidMap objects. However, to keep the API similar to the QidMap object, each entry has the same value for its key and value here, so that an array [qid, qid] is returned.

      Returns Iterator<Qid, Qid, QidSet>

    • Create a new QidSet by filtering the current QidSet.

      Parameters

      • OptionalcallbackFn: (qid: Qid) => boolean

        A function that should return true for elements that should be included, when no callbackFn is passed all Qids will be included

      Returns QidSet

      A new QidSet with the filtered Qids

    • The forEach() method of QidSet instances executes a provided function once for each Qid in this set

      Parameters

      • callbackFn: (qid: Qid) => boolean
      • OptionalthisArg: unknown

      Returns void

    • A convenience method that extracts all the unique Vid's of the Qids in this QidSet

      Returns Set<string>

      A Set containing the unqiue Vid's in this QidSet

    • Check whether this QidSet contains the given Qid

      Parameters

      • qid: Qid

        The Qid to check

      Returns boolean

      Whether this QidSet contains the given Qid

    • Calculate the intersection of two QidSets; All Qid's that are in both QidSet.

      Parameters

      • other: QidSet

        The other QidSet

      Returns QidSet

      A new QidSet with the intersection of this QidSet and the other QidSet

    • Generate a string that can be used in a BQL condition

      Example use: "buildingStorey.qid " + floorQids.toQidCondition() + " AND type != IFCSPACE"

      Returns string

    • Generates a string representation of this QidSet in the form of a comma-separated and per-Qid double-quoted string

      Example: A QidSet with 2 QIDs would be represented as: "227e071d-4909-4b5c-8d48-46f44d027c46-1", "227e071d-4909-4b5c-8d48-46f44d027c46-2"

      The returned String is usually used to plug into a String representation of a BQL (BIM.works Query Language) query, for example:

      GET attribute.Name WHERE qid IN ("227e071d-4909-4b5c-8d48-46f44d027c46-1", "227e071d-4909-4b5c-8d48-46f44d027c46-2")

      When allowCompact is enabled the same QidSet would be represented as: "227e071d-4909-4b5c-8d48-46f44d027c46"[1, 2], which is also valid in a BQL query

      Parameters

      • OptionalallowCompact: boolean

        Whether the implementation is allowed to use the compact representation, defaults to true

      Returns string

      A String representation of this QidSet

    • Create a new QidSet by providing an Iterable, the values in the Iterable must be either:

      • Valid Qid Strings
      • Qid instances
      • JS Objects that have both the vid:string and oid:number properties

      Parameters

      • iterable: Iterable<string | object | Qid>

      Returns QidSet

      A QidSet of all the Qids in the Iterable