Get all objects and their area

i am new to scripting , have basic knowldege of c , c++, php

now i want to write simple script in Richno to get area of all objects in richo or say simple such thing like for looping all objects and adding their areas

below if my cocept

int areatotal =0
array allobjects = Get all richno objects
foreach(allobjects as currentobject){
areatotal = areatotal +area(currentobject)

return areatotal

please help me ,

The concept is OK. What language are you wanting to use, VBscript or Python?

You might want to ask the user to select objects for area (more flexible) and/or filter for certain types of objects - only closed curves or surfaces or…

Also, the area/volume functions normally return an array with the area and an error bound, so you will need to filter for that.

This code sample shows how to do this for curve length, area would be similar.

Check the Rhinoscript help for more info…