BOM (Bill Of Materials) function

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Kunda1
Posts: 9223
Joined: Thu Jan 05, 2017 9:03 pm

Re: BOM (Bill Of Materials) function

Postby Kunda1 » Thu Oct 10, 2019 9:21 am

Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
ToniTen
Posts: 60
Joined: Fri Sep 04, 2020 10:11 am

Re: BOM (Bill Of Materials) function

Postby ToniTen » Mon Nov 16, 2020 12:05 pm

realthunder wrote:
Mon Dec 03, 2018 4:46 am
I was about to release my new version of asm3, then I was summoned here. So it looks like BOM list may be a popular demand. So I made some last minute commits to show what my branch is now capable of.

And if you wonder how such spreadsheet is made, here is a glimpse of its inside. The scripts uses Python syntax, but is not interpreted by Python. Instead it is fully interpreted by FC expression module. Except for defining object, you can pretty much do anything, even raise and catch exceptions. It gives user the ultimate freedom to do whatever he can image, or at least that's the goal.
Wow very nice

Since this was made a long time ago, I assume this was integrated already in the version of Assembly3 that is available in the Appimage. Is is possible to find your scripts so they can be used without having to retype them by hand? Even if the goal is to give as much freedom to the user, having a working version that one can tweak can be a great learning tool
User avatar
Zolko
Posts: 1189
Joined: Mon Dec 17, 2018 10:02 am

Re: BOM (Bill Of Materials) function

Postby Zolko » Mon Nov 16, 2020 12:50 pm

kbwbe wrote:
Sun Dec 02, 2018 10:38 pm
A2plus is already now able to extract a partlist from all used components and subassemblies.
realthunder wrote:
Mon Dec 03, 2018 4:46 am
So it looks like BOM list may be a popular demand.
yes, indeed, BoM is a very popular demand. What a BoM function does is:

  • parse the model tree
  • follow or not into containers (App::Link, App::Part, others...) to a level that can be specified by the user
  • find parts of certain types, also specified by the user (Fasteners are of type App::FeaturePython for example, the BoM needs to recognise them, but datums should not be listed)
  • check whether it's a new entry into the BoM or increment the count if there are already identical parts
  • find information about these parts, like material, size, supplier ... provided by the part itself
  • write it all out into a spreadsheet, ideally using customisable templates
Here I'd say that instead of every (assembly) workbench implementing its own (incompatible) solution, a generic BoM function (WB ?) that does it for all FreeCAD files would be very useful. Only the "following into containers" part is specific to each assembly workbench, all the rest could (and should) be generic.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here