```
require 'sketchup'

entities = Sketchup.active_model.entities
summa = Hash.new

for face in entities
  next unless face.kind_of? Sketchup::Face
  if (face.material)
    summa[face.material.display_name] += face.area
  end
end

```

I'm trying to get the structure in the array as such:

```
summa { "Bricks" => 500, "Planks" => 4000 }

```

By the way, I'm making a ruby script for Google Sketchup

But if I run this code I only get 

```
Error: #<NoMethodError: undefined method `+' for nil:NilClass>
C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\test.rb:17
C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\test.rb:14:in `each'
C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\test.rb:14
C:\Program Files (x86)\Google\Google SketchUp 7\Plugins\test.rb:8:in `call'

```

As I'm used to using PHP and just doing `$array['myownassoc'] += bignumber;`
But I guess this isn't the right approach when using Ruby?

So any help in how I need to go would be nice.