FreeCAD BOM Generator

From Open Source Ecology
Jump to navigation Jump to search

Tools That Can Be Used For Generating Bills of Materials by Counting

Structured Way

  • The simplest method of obtaining a complete BOM, line by line, is to export parts spreadsheet in a FreeCAD document, and simply count them. You can count phrases by using an online phrase counter - [1]. That is your BOM Generator MVP1.0.
  • For this to work, the part names must be structured in an understandable way, such as "8 mm Screw #" such that every time it is copied, it appears as: "8 mm Screw #0"
  • Limitation is that you just need to treat parts as primitive parts, meaning descibe a material exactly such as 2x6x8, or 2x6x16. You can't do something like 'sill plate 2x6x8' - because it will not count it with 'wall module 2x6x8
  • Check out what happens when you copy a part, if its name allows for easy counting by examinging part name:

Partcopies.png

  • The count appears readily by observing the last number.
  • Out of the box - you can even include a BOM link to that part with URL or shortcut, so that the exported BOM can include links out of the box:

Part+url.png

  • The above looks trivial - but if done - one has automated capacity to generate full and correct clickable BOMs in FreeCAD. For example, if a design contains a house design made of multiples of various modules - all the parts can be summed automatically - with ordering links provided. This is powerful help for automated custom design.
  • FreeCAD allows CSV export of part spreadsheets - so further processing into finished BOMs can happen readily.

Summary of Parn Naming Convention for Phrase Counter Method

  • Always name a part as a group of 2 words (this treats the entry as a 'phrase'). This also allows for logical naming of parts.
  • Do not use a single word for counting, as it doesn't count a single word as a phrase.
  • Do not use additional descriptors for the basic part, such as 'floor 2x6 lumber' and 'wall 2x6 lumber' - just use '2x6 lumber'

Extracting Parts Spreadsheet in FreeCAD

There is a macro from FreeCAD forum [2]:

obj = FreeCADGui.Selection.getSelection()

bom = App.activeDocument().addObject('Spreadsheet::Sheet','BOM') cell = 0 for x in obj:

   cell = cell + 1
   bom.set("A" + str(cell), x.Label)

App.ActiveDocument.recompute()

You can execute this macro in Macros or in the Python console. Select the parts in the tree view, and you will generate a spreadsheet with all the parts.Then these parts can be counted.

  • This generates a spreadsheet, from selected parts in part tree
  • Export this to CSV using Spreadsheet Workbench for other spreadsheet apps.
  • Spreadsheet workbench allows import of CSV as well.

Note on Groups

If you organize parts in folders (ie, Create group...) - the group name also appears in the above list:

Group.png

Thus- you can count groups as well (if you name them with space and number at the end so there is a clear name). So for example, you can extract that you have 2 roof modules, 5 walls, with 50 2x12s, 100 hangers, etc. For the 1000 sf Seed Home 2, counting number of roof sections is done easily from the CAD, so it may be useful to only sum up the individual parts, and avoid counting obvious parts.

FreeCAD BOM Automation - Evolution

2018 Progress

  • Note comment: part organization is what makes for proper assemblies - not constraints! Exactly. [3]

2017

https://forum.freecadweb.org/viewtopic.php?t=23592

Links

Applications