Area surface

Hello friends
How to get the area with C # and Python?

pyyy.gh (9.3 KB)

#python
from Rhino.Geometry import AreaMassProperties
amp = AreaMassProperties.Compute(srf)
area = amp.Area
centroid = amp.Centroid
//C#
private void RunScript(Surface srf, ref object Area, ref object Centroid)
{
  var amp = AreaMassProperties.Compute(srf);
  Area = amp.Area;
  Centroid = amp.Centroid;
}

Fatemeh.gh (7.3 KB)

5 Likes

thanks Teacher