Hi !
Is there a way to access the information contained in Area metrics > Units > Unit distribution ? I have checked the whole documentation about forma-embedded-view-sdk but I can't find a way to access this information.
Thanks for your answer!
Hei @helpBJ5T4:
Thanks for your question.
I believe you can find them under the AreaMetrics API. For example:
const currentlySelected = await Forma.selection.getSelection()
const areaMetrics = await Forma.areaMetrics.calculate({
paths: currentlySelected
})
console.log(areaMetrics.unitStatistics)
Hi !
Thanks a lot for your answer. However, I try it on the building or the floor element and I only have this result, whereas I have some units :
{id: 'unit_count', name: 'Number of units', unitOfMeasurement: 'COUNT', value: 0}
Do you have an idea ?
Thanks a lot !
Hi !
Thanks a lot for your answer. However, I try it on the building or the floor element and I only have this result, whereas I have some units :
{id: 'unit_count', name: 'Number of units', unitOfMeasurement: 'COUNT', value: 0}
Do you have an idea ?
Thanks a lot !
Lucas
Hei @helpBJ5T4
I believe the whole point of API is to give you the information already available on the screen. So, If you want to produce/get the information regarding the unit distribution, I would recommend drawing a House Under Building tool. Now If I select that building and then perform the below operations -
const currentlySelected = await Forma.selection.getSelection()
Then I would get something like ['root/12bdf6d'], the path of that selected building/element.
const areaMetrics = await Forma.areaMetrics.calculate({
paths: currentlySelected
})
Now, this will give me an array of objects -
{customMetrics: Array(3), builtInMetrics: {…}, unitStatistics: {…}, parkingStatistics: {…}}
And from that object, one can retrieve the `UnitStatistics`.
And, the whole point here is, does the information available on the screen/proposal?
Can't find what you're looking for? Ask the community or share your knowledge.