4.3 - Project Info
The project information is a JSON object containing details about the project structure and content.
Event name | Input / Output | Payload | Reason |
---|---|---|---|
getProjectInfo | Input event | None. | Request the Project Info for the current state. |
projectInfo | Output event | See the description below. | Receive the requested project info. |
Exampleβ
// Receive the project info.
configurator.addEventListener("projectInfo", (event) => {
console.log(event.detail);
});
// Send a request to get the project info.
configurator.dispatchEvent(new CustomEvent("getProjectInfo"))
Payload descriptionβ
The Project Info is a complex JSON object. At the top level, it contains the following attributes:
Attribute name | Type | Content |
---|---|---|
anchors | Array of Anchors data. π | When a modular product is loaded, this contains the links between products. |
products | Array of Product data. π | This will contain the products currently loaded. |
modularContext | Optional Modular context. π | When a modular product is loaded, this is the linked Modular Context. |
Productβ
This is the description of a product or sub product.
Attribute name | Type | Content |
---|---|---|
dbID | string | The identifier of this product in the database. If you load the same product multiple times, the dbid will be the same. |
parameters | Array of Parameters. π | The parameters of this product. |
subProducts | Array of Products. π | The sub products of this product. |
transfo | matrix4 | The transformation matrix of the product, corresponding to its position in the 3D scene. |
uuid | string | A unique random identifier for this instance of the product. |
Parameterβ
This is the description of the parameter of a product.
Attribute name | Type | Content |
---|---|---|
id | string | The identifier of this product in the database. If you load the same product multiple times, the dbid will be the same. |
type | number | A number indicating the type of the value: 1: number (Real) 2: integer 3: boolean 4: string 5: string (color) 6: string (material dbid) 7: string (product dbid) |
value | See the "type" attribute. | The current value of this parameter. The type depends on the "type" attribute. |
Anchorsβ
When a modular product is used and multiple modules are loaded, they are attached by anchors. An anchor in the project info is represented by these attributes:
Attribute name | Type | Content |
---|---|---|
furnitureUUID | string | The unique identifier of a product. |
attachments | An array of objects | Each object matches an anchor of the product, with the following attributes:anchorIndex : number (the index of this anchor on this product)attachedUUID : string (the UUID of another product attached using this anchor) |
Modular Contextβ
When a modular product is loaded, this contains information about the product used as a Modular Context. π
Attribute name | Type | Content |
---|---|---|
productDbId | string | The database identifier of the product used as a modular context. |