'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '' '' http://ofthiswearesure.com/rhino '' '' (c) bryan boyer 2007, of this we are sure '' this script comes with no guarantee and '' barely any help. be smart, save you work, '' sleep regularly, tip your waiter, and '' clean up your own mess. '' '' boolarea lets you calculate the area of a shape '' in plan without having a closed polyline or '' surface. this should let you work much quicker '' when doing basic space allocations in a plan '' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' Dim blnSuccess, arrStoredCurves, arrCurves, arrSrfs, arrArea, strSrf, strObject arrStoredCurves = Rhino.SelectedObjects blnSuccess = Rhino.Command("Curveboolean") Rhino.UnselectAllObjects If blnSuccess = True Then arrCurves = Rhino.LastCreatedObjects If UBound(arrCurves) >= 1 Then If IsArray(arrCurves) Then Rhino.print "## We've detected multiple shapes. If you've made a torroidal selection" Rhino.print "## it's ok, otherwise this area calculation may be incorrect." arrSrfs = Rhino.AddPlanarSrf(arrCurves) Rhino.DeleteObjects(arrCurves) strObject = arrSrfs(0) 'Rhino.Print(strObject) arrArea = Rhino.SurfaceArea(strObject) Rhino.Print(Round(arrArea(0),3) & "sq units") Rhino.DeleteObjects(arrSrfs) End If Else arrArea = Rhino.CurveArea(arrCurves) Rhino.Print(Round(arrArea(0),3) & "sq units") Rhino.DeleteObjects(arrCurves) End If ' for some reason rhino selects text and dots when we run this ' so now we need to deselect everything Rhino.UnselectAllObjects If Not IsNull(arrStoredCurves) Then Rhino.SelectObjects arrStoredCurves End If End If