Total area of the apartment

Hi,

I come to you with a problem that occurred when I tried to use Dynamo script to describe the total living area for each apartment, separately for each floor.

I created a script, that first filters out rooms containing “K” and “T” in the “Apartment Number/Room Name” parameter. Then it sorts by the “Floor Number” parameter. So far, it looks okay, but i`m having trouble applying double sorting - to sort both by floor and apartment number (on each floor, i have apartment numbers 01-13).

The next task for the script would be to apply the sum of the areas for each apartment on each floor and fill in the parameter according to the apartment number and floor.



Currently, the script calculates the area for the entire floor and fills in the parameter for several rooms.
I searched the forum for information, but I did not find a solution to my problem.
Skrypt na opisywanie mieszkań - sumaryczna powierzchnia.dyn (82.4 KB)

Has anyone encountered something similar or can suggest a solution/hint?

1 Like

@krzysztof.nowakFWCRN ,

i think you can simplify your script! like this


KR
Andreas

I tried that, but it calculates for the entire floor then, there is a lack of the second filter.

In script i have something like that too:


but it still didnt work like i want to :frowning:

@krzysztof.nowakFWCRN ,

first you need a parameter f.e. TOP… all rooms from that aparment sorted by this Parameter…
f.e. Apartment A,B,C,D or Apartmente F01, F02, F03,…

you can groupThemByKey and sum up it…
optional you can create a dictionary…

KR

Andreas

Yes, sorting for the room number works, but it counts values ​​for the entire building. And I want it to count for each floor separately - (on the ground floor I have numbers 01-12, on all floors 01-13)

@krzysztof.nowakFWCRN ,

than group by floor i mean Level…

Okay, I got:

But how can i sort it now? I tried but… :

I know my questions may be stupid but i’m trying to understand it

@krzysztof.nowakFWCRN ,

i think you can go directly here


the dictionary is just a candy to sort it this way…

do want to export to excel, or just grouping rooms ?

KR

Andreas

The task for the script would be to apply the sum of the areas for each apartment on each floor and fill in the parameter according to the apartment number and floor:


Is it possible?

That works almost fine. Now it calculate area for apartment with number 01/02/03 for each level and fill it with that value:



I have to dived this sum by floor - on each floor apartment area is different but i dont know how to do it :confused:
Skrypt na opisywanie mieszkań - sumaryczna powierzchnia.dyn (106.4 KB)

You need to manage the list levels when using SortByKey/GroupByKey to sort and group by sublist, otherwise you’re just reordering everything.

Something like this:

2 Likes

@Nick_Boyts
Which dynamo version are you using?
I don’t have these nodes.

My dynamo is:
image

Those are python nodes I created for my example. You would replace them with your method for getting those parameters or sub-properties.