Qid
Class in @bimworks/jssdk.
API catalogue · @bimworks/jssdk · Class
Qid stands for Unique Identifier. It uniquely (and globally) identifies an object in BIM.works. It's String representation is a concatenation of a Vid and Oid Joined by hyphen: "vid-oid": Example: "227e071d-4909-4b5c-8d48-46f44d027c46-1" For memory efficiency, it is advised to not pass around the String representation in a JavaScript context, but use these Qid objects.
For efficient aggregation of Qids, you can use QidSet and QidMap.
This class does not have a public constructor, use any of the following static methods to get a reference to a Qid:
ofVidOidofStringof
Members#
| Member | Kind | Description |
|---|---|---|
| oid | Method | |
| vid | Method | |
| equals | Method | |
| toString | Method | |
| of | Method | Get a reference to a Qid by passing "anything". Anything can be either: - A Qid instance, this method will simply return the passed object as-is - A JS Objec… |
| ofString | Method | Get a reference to a Qid object by providing it's String representation. When your end goal is to convert a JS array/iterable of string to a QidSet, consider… |
| ofVidOid | Method | Get a reference to a Qid object by it's vid+oid |
oid#
oid(): numberReturns#
The Oid (Object ID) part of this Qid
vid#
vid(): stringReturns#
The Vid (Version UUID) part of this Qid
equals#
Parameters#
| Name | Type | Description |
|---|---|---|
other |
Qid | Must be another Qid instance |
Returns#
Whether the other qid is equal to this qid
toString#
toString(): stringReturns#
This Qid's String representation in the form of Vid and Oid Joined by hyphen: "vid-oid": Example: "227e071d-4909-4b5c-8d48-46f44d027c46-1"
of#
Get a reference to a Qid by passing "anything". Anything can be either:
- A Qid instance, this method will simply return the passed object as-is
- A JS Object, this requires a "vid" and "oid" member to be available on the object
- A String, it is required that the String is constructed Vid and Oid Joined by hyphen: "vid-oid": Example: "227e071d-4909-4b5c-8d48-46f44d027c46-1"
Of neither of the above was provided an exception is thrown
Parameters#
| Name | Type | Description |
|---|---|---|
qid |
string | object | Qid |
A Qid, String or Object |
Returns#
A Qid
ofString#
Get a reference to a Qid object by providing it's String representation.
When your end goal is to convert a JS array/iterable of string to a QidSet, consider using QidSet.ofIterable which is more performant
Parameters#
| Name | Type | Description |
|---|---|---|
qid |
string |
The String representation of a Qid |
ofVidOid#
Get a reference to a Qid object by it's vid+oid
Parameters#
| Name | Type | Description |
|---|---|---|
vid |
string |
A Vid (Version UUID) |
oid |
number |
An Oid (Object ID); |
Returns#
A Qid