#Layers and products

After diag.loadCloudData the diagram is loaded, we can expect that the diag.layers and diag.products arrays are defined and contain the m2Diag.Layer and m2Diag.product objects placed in the diagram. Each layer references the room items that it contains by their unique id. This allows you to see what's in the floor plan diagram.

Here are sample layers ( visit the API reference for more details ):

diag.layers[0] = {
  ...
  // unique id for the layer
  id: "cr-Yq-0b",
  // the rooms in the layer
  rooms: []
}

Here is a sample product item ( visit the API reference for more details ):

// get the products assigned in the diagram project
diag.products
.find(prod => prod.id === 'one_product_id') = {
  ...
  // unique id for the product
  id: "one_product_id",
  color: "#DCDCDC",
  type: "Carpet"
}

results matching ""

    No results matching ""