Page 4 of 6

Re: BOM (Bill Of Materials) function

Posted: Thu Oct 04, 2018 1:19 pm
by Kunda1
Very encouraging: KiCAD demo
Interactive Html Bom Plugin: https://forum.freecadweb.org/viewtopic.php?f=8&t=31344

Re: BOM (Bill Of Materials) function

Posted: Sun Dec 02, 2018 9:44 am
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.

Re: BOM (Bill Of Materials) function

Posted: Sun Dec 02, 2018 10:47 am
by Kunda1
Woah Nelly! This looks awesome!

Re: BOM (Bill Of Materials) function

Posted: Sun Dec 02, 2018 11:26 am
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.

Re: BOM (Bill Of Materials) function

Posted: Sun Dec 02, 2018 11:58 am
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

Re: BOM (Bill Of Materials) function

Posted: Sun Dec 02, 2018 10:38 pm
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.

Re: BOM (Bill Of Materials) function

Posted: Sun Dec 02, 2018 10:53 pm
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.

Re: BOM (Bill Of Materials) function

Posted: Mon Dec 03, 2018 4:46 am
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

Re: BOM (Bill Of Materials) function

Posted: Mon Dec 03, 2018 10:45 am
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 4557 times
The partslist on level of the main-assembly:
partslist-mainassembly.png
partslist-mainassembly.png (86.74 KiB) Viewed 4557 times
The partslist with all components, resolved from subassemblies:
resolved-subassemblies.png
resolved-subassemblies.png (142.28 KiB) Viewed 4557 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 !

Re: BOM (Bill Of Materials) function

Posted: Mon Dec 03, 2018 10:52 am
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!