SurfaceAreaCentroid returns an array, where the first value is the point.
So you would need to do: areaCentroid = Rhino.SurfaceAreaCentroid(ObjectforCG)(0)
or if not above, then use: areaCentroid(0)(0).areaCentroid(0)(1),areaCentroid(0)(2) for your point coordinates.
So if I wanted to select multiple surfaces and get the area centroid of all of them…
would do a for each surface in group of surfaces and then add the values up and divide by the # of items, correct?
Is there an easy way to count how many surfaces are grabbed in the Get.Objects? Or would it be better to just have a counter and increment it each time the loop runs.
You can use Ubound(arrResult) - it will give you the number of items in the array -1 (arrays are 0-based).
For multiple surfaces you need to iterate thru all of them, I don’t think you can get an average centroid for bunch of them at once…