Bill of materials

Hi,

I use Blender as a 3D sketch tool for building terrariums and racks for them or plan my next trip to IKEA.
What I need is a tool that lists all Objects with there names and measurements (Bounding box is ok - I use mostly cubes) and how much of them I uses in the scene - a bill of materials BOM in short.
Does this exist or do I need to code it by my self?

Regards,
Dominik

You mean all objects of type “MESH”, don’t you?
all objects are found in bpy.data.objects,
check if it is a mesh, then write its name and boundingbox coordinates to a file

I think it does not yet exist, but it is only some small number of commands … so do it youself :wink:

Yes that is exactly what I have in mind.
It seams strange to me that nobody did that before - well then at least my googlefu was not that bad.

Now I know what I will do after work :RocknRoll:

I had no time left to fix the presentation but this is what I uses to create my shopping list :wink:


import bpy

bom = list()
objects = bpy.data.objects
for ob in objects:
    if ob.type == 'MESH':
#        print(ob.name.split('.'))
        name = ob.name.split('.')[0]
#        print(name)
#        print(ob.dimensions)
        x = int(round(ob.dimensions[0],3) * 1000)
        y = int(round(ob.dimensions[1],3) * 1000)
        z = int(round(ob.dimensions[2],3) * 1000)
#        print(x,y,z)
        try:
            bom[0]
        except:
            bom.append([name,(x,y,z),1])
        found = False
        for item in bom:
            if item[0] == name and item[1] == (x,y,z):
                item[2] = item[2] + 1
                found = True
        if found == False:
            bom.append([name,(x,y,z),1])

for thing in bom:
    print(thing)

bom.blend (1.05 MB)

So, I’ve bought the wood for this project. As it happens I’m working on the planing of the next project and was thinking that the display/output of the BOM needs to be improved - suggestions and pointers are most welcomed :wink:

Regards
Dominik

I created a cut list application in python for the current version of blender (3.01). The source and readme are in github here: https://github.com/TimHuckaby/Blender-Cut-List

I heart Huckabys :grinning:

Nice, just need to adapt it to metrics. Thanks, man. Btw, also works in 2.93.