Hello everyone,
is there any way to add door area to Host wall.
i have used parameter “DoorArea” in Door family for calculate Door area, and Second i have added “DoorArea” to Wall with Project Parameter (instance).
as you can see i am sucessfully add single door area with single wall. but what if single wall have more then one door. i am not able to calculate that. so i need some guidance.
First group the doors by their host with a list.GroupByKey node. I believe you will need to pull the ID of the walls with an Element.Id node. Use the converted value as the key. The area of the doors should be the list.
Then use a Math.Sum with longest lacing to get the total value of each sublist from the ‘groups’ output of the List.GroupByKey node.
Then convert the keys from the List.GroupByKey node back to elements (either by selecting by ID or by selecting by the ID or by grouping the walls, or by getting the index and pulling the elements that way, or one of a dozen other methods of list management), and set the values accordingly.
One thing to watch - I’m not sure it would ever occur though - is if your walls somehow become ‘out of order’ with the grouping order. You might want to do a manual check of this - not an easy task at scope. Better yet sort the walls using the element ID node as a key, and sort the list of groups by the keys.
A good way to handle that is to combine your two lists of data into one list and then transpose the list. This way you get a list of tuples.
0-
0 - MyDoor
1 - Door Id
1-
0 - MyDoor
1 - Door Id
This lets you keep the items and associated data grouped as they make their way through the script.