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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: BOM (Bill Of Materials) function

Post by Kunda1 »

Very encouraging: KiCAD demo
Interactive Html Bom Plugin: https://forum.freecadweb.org/viewtopic.php?f=8&t=31344
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
andrew.j.smart1988
Posts: 16
Joined: Tue Sep 05, 2017 2:03 am

Re: BOM (Bill Of Materials) function

Post by andrew.j.smart1988 »

My take on the bill of materials, which uses a 3D model as input (not technical drawings)

See this video on Product Breakdown Structure (PBS):
How to Organize Your Project with a PBS System - Marble Machine X #57 (sample PBS document and analytics document below video)

I have extended their work, to automate the creation of the document using a STEP imported to FreeCAD. I was not so interested in the analytics in the video, but the creation of a Bill of Materials (BOM) from the CAD model. Finds all instances of parts in model hierarchy and shows total quantity, among other teamwork features.

Example model (exported to STEP, imported to FreeCAD).
Example PBS/BOM document.

Process:
  • 1. FreeCAD Macro
    • INPUTS: CAD model
    • OUTPUT: CSV Export
    2. Google Sheet (concurrent edit possible with team, document history, unlike Excel)
    • 1. Merge CSV Tab into PBS tab by hand, not automatic yet (copy CAD ID, name, quantity columns)
      • INPUTS: PBS/BOM document (headers), CSV Import into new tab
      • OUTPUT: PBS tab
      2. update_pbs_numbers macro - Tools->Macros->update_pbs_numbers - macro is javascript within the Google Sheet
      • INPUTS: PBS tab
      • OUTPUTS: PBS tab with PBS #s, and part categorization (assembly,part)
      3. populate_tabs macro - Tools->Macros->populate_tabs
      • INPUTS: PBS tab
      • OUTPUTS: BOM tabs (overwrites existing BOM data)
Code here (includes FreeCAD macro, and copy of javascript code within Google Sheet). Done in work towards this project. End users include people interested in building the open-source project themselves, they can easily see: how much of each part to 3D print, how much hardware to order, and where the hardware goes in the hierarchy. Team working on the project can use the other columns in the PBS document to collaborate as shown in the video, and is freed of some bookkeeping duties thanks to the automation.

PBS hierarchy can be edited to include parts not within the CAD model (e.g. wires/nails). I hope to classify the part type (e.g. 3D print/hardware/lasercut/machined) by CAD color and separate into the appropriate BOM tab, so that it doesn't have to be classified by hand. Maybe made into a visual BOM via macro exporting images for each part/assembly.
Last edited by andrew.j.smart1988 on Sun Dec 02, 2018 11:25 pm, edited 2 times in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: BOM (Bill Of Materials) function

Post by Kunda1 »

Woah Nelly! This looks awesome!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: BOM (Bill Of Materials) function

Post by saso »

Very nice indeed! At the same time it also nicely shows how important the proper Assembly-Part structure is and that constraints (as the mayor focus in development in A2, A2Plus and A3) are NOT what makes Assemblies.

As a side note, in building constructions this is normally done not in a BOM (Bill Of Materials) like way but within "construction calculations" and they normally always include PBS (Product Breakdown system) + WBS (Work Breakdown System)... Just to show that if we want to satisfy all the different FreeCAD users things are not always so simple, but still we should try to do it.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: BOM (Bill Of Materials) function

Post by Kunda1 »

saso wrote: Sun Dec 02, 2018 11:26 am Very nice indeed! At the same time it also nicely shows how important the proper Assembly-Part structure is and that constraints (as the mayor focus in development in A2, A2Plus and A3) are NOT what makes Assemblies.
kbwbe wrote:ping
@kbwbe may be interested in this
realthunder wrote:ping
@realthunder as well
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: BOM (Bill Of Materials) function

Post by kbwbe »

Kunda1 wrote: Sun Dec 02, 2018 11:58 am
Thx Kunda for the info !
saso wrote: At the same time it also nicely shows how important the proper Assembly-Part structure is and that constraints (as the mayor focus in development in A2, A2Plus and A3) are NOT what makes Assemblies.
Hi saso,
this is a question of strategy. If for your work it is good enough to have all components in one file, you can prettily work with Part containers. But if you want to have each component in a separate file, as usual in industry, you need an assembly WB. A2plus is already now able to extract a partlist from all used components and subassemblies. Even without making use of Part containers.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: BOM (Bill Of Materials) function

Post by saso »

kbwbe wrote: Sun Dec 02, 2018 10:38 pm A2plus is already now able to extract a partlist from all used components and subassemblies. Even without making use of Part containers.
Can you show me an example of an assembly tree structure of parts (components?) and subassemblies done in A2plus?

Here I did some examples of what an proper assembly structure inside FreeCAD would IMO look like https://forum.freecadweb.org/viewtopic. ... 00#p238042 and https://forum.freecadweb.org/viewtopic. ... wm#p253226 If those parts and assemblies are all in one file or if they are linked from different files or if there are constraints between those parts and subassemblies or not it should not matter because external links and constraints don't make assemblies.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: BOM (Bill Of Materials) function

Post by realthunder »

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.

Image

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.

Image
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: BOM (Bill Of Materials) function

Post by kbwbe »

saso wrote: Sun Dec 02, 2018 10:53 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. Even without making use of Part containers.
Can you show me an example of an assembly tree structure of parts (components?) and subassemblies done in A2plus?
A2plus is able to generate a Partlist from an assembly and a cumulated Partlist over all included subassemblies. Nothing more i told.
Here are the screenshots:
The main-assembly:
main-assembly.png
main-assembly.png (93.15 KiB) Viewed 4480 times
The partslist on level of the main-assembly:
partslist-mainassembly.png
partslist-mainassembly.png (86.74 KiB) Viewed 4480 times
The partslist with all components, resolved from subassemblies:
resolved-subassemblies.png
resolved-subassemblies.png (142.28 KiB) Viewed 4480 times
If you want to see everything in the treeview, it is not. But it is very easy to generate a list of all parts which are needed. I think this meets basic needs of users. If it does meet your needs, i do not know !
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
kbwbe
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: BOM (Bill Of Materials) function

Post by kbwbe »

realthunder wrote: Mon Dec 03, 2018 4:46 am
Hi @realthunder,
congratulations to your whole work up to now !

The spreadsheet improvements are very useful for many things.
One question: Is it possible to disable python code execution in spreadsheets if i get files from untrusted sources ?

Edit: Sorry, i do not want to highjack this thread!
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.56, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Post Reply