Help with Group by Key

#1

I need some help… I am looking to group all of the family types of wall and then collect all of the area of the wall types and export that to excel. Any one have an easy solution…?

0 Likes

#2

hi @astone
This sould solve your problem

0 Likes

#3

Yeah, that does not allow me to calculate the area of type of wall…

0 Likes

#4

The easiest option would be a Revit Material Take-off Schedule.

0 Likes

#5

True, that was my first option, however i need to get the data to write to excel takeoff sheet…

0 Likes

#6

You could use BimorphNodes package GetScheduleData then simply export the table data to Excel. If your Excel already contains formulae then use @Konrad_K_Sobon Archi-labs Excel exporter (I think the package is called bumblebee) since the Dynamo Excel exporter destroys preexisting formulas (its a known bug)…

0 Likes

#7

Just adjust my previous graph a bit

1 Like

Pull values from sublist, add new values to sublist
#8

You could also write your own ‘Type Summation’


The code in the example has two possible outputs, adjust commenting for the solution you want.

import sys
sys.path.append('C:\\Program Files (x86)\\IronPython 2.7\\Lib')
import collections

#The inputs to this node
fam = IN[0]
area = IN[1]

#group the values in a dictionary
elemVal = collections.defaultdict(int)

#sum grouped values
for f, v in zip(fam, area) :
	elemVal[f] += v

#Output sorted as types(list0) and sums(list1)
OUT = zip(*elemVal.items())

#Output sorted as types and sums (grouped)
#OUT = elemVal.items()
0 Likes

Python Nodes Basics
Pull values from sublist, add new values to sublist
Pull values from sublist, add new values to sublist
#9

Thanks, that worked!

0 Likes