Hi everyone,
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:
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.
That’s awesome, I’ll give it a try. How come you set ‘totalVolume = 0’ before running the array? To reset the totalVolume value in memory so it doesn’t keep adding up?