Bare with me, I used to know Maxscript pretty well, and could write different scripts/macros to perform different tasks. This was over 10 years ago now, and this isn’t Max or Maxscript, this is Rhino and Python. I’ve roughed out this script, which works for one pre-selected object, as long as your units are set to CM by default. It then outputs the weight of the solid/closed object in kg:
import rhinoscriptsyntax as rs import scriptcontext as sc def ObjectWeight(): intUnits = rs.UnitSystem(1) factor = rs.UnitScale(intUnits, 3) obj = rs.SelectedObjects() vol = rs.SurfaceVolume(obj) volume = vol print "Volume =", volume print "Objects Weight in Aluminum is:", ((volume * 2.73)/1000), "kg" ObjectWeight()
I need to figure out how to create an array so I can collect the volume for each object pre-selected, run ‘ObjectWeight()’ on it, and add up all of the volumes, and do my weight calculation based on density.
for items in obj() do ObjectWeight()
I forget how its laid out, how to add together each value from the array into a new value. I know i’m way in over my head, but if I can learn how to do this again, I’ll be able to stumble through the rest I think.