Code Monkey home page Code Monkey logo

billofmaterials-wb's Introduction

Alternate text

Bill of Materials-WB

A workbench to create Bill of Materials (BoM) independent of the assembly workbench of your choice. With this workbench, different types of the BoM can be created:

  • a total BoM with all the parts and subassemblies (the deepest level can be set).
  • a summary BoM.
  • a parts only BoM.
  • a first level BoM (useful for assembly pages.
  • a raw BoM. (This is a BoM, just as is. No summation of parts and assemblies. Can be used for testing or creating your own BoM in programs like Excel.)
    Standard the following columns are added to the (BoM):
  • Number.
  • Quantity.
  • Label. -> This will be the label of the original part or assembly.
    For example in an assembly 3 assembly, parts are named like "Link001". This will be replaced with their original label like "bearing", "axis", etc).
  • Description -> This is label2 in the property view.

Optionally, every property from the property view can be added from either the assembly document or a document selected in the tree.
For debugging the option "Enable extra columns for debug" can be enabled. This option will add the following columns:

  • Original label. -> The original name in the assembly. For example in an assembly 3 assembly this will be "Link001", "Link002", etc.
  • Type. -> Part or Assembly
  • Internal name.
  • Fullname.
  • TypeId.

Supported assembly types:

  • a2plus
  • Assembly 3
  • Assembly 4
  • Internal assembly workbench (This workbench is still in development)
  • Applink / ApplinkGroup assemblies
  • AppPart assemblies

This workbench is still under development. Therefore there are some limitations.
Support for the following assemblies, workbenches and futures are planned:

  • Improvement on assembly type detection, so assemblies can be placed in groups. -> Done. Ready for testing
  • Support for the Arch WB
  • Support for multi-body parts (Part WB)
  • One function to support a mixed structure of all assembly workbenches
  • A function to add the BoM to a TechDraw page template
  • Mass calculation based on shape and material
  • outer dimensions of items -> Done.

License:

LGPL2.+

billofmaterials-wb's People

Contributors

apebbers avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

billofmaterials-wb's Issues

Can't find icon for Preferences–page in 0.22.dev

When opening the preferences from FreeCAD (Edit ⇒ Preferences…) I get the warning Cannot find icon: preferences-bill_of_materials, and instead of your icon, there is a white square with a black X inside of it.

grafik

OS: Arch Linux
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36166 (Git) AppImage
Build type: Release
Branch: main
Hash: a5ea8023a29b6d7bbf1ebd57b5ed31dd27c5947b
Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3
Locale: English/United States (en_US) [ OS: German/Germany (de_DE) ]
Installed mods: 
  * BillOfMaterials 0.0.5.6
  * Assembly4 0.50.7
  * A2plus 0.4.63
  * BOLTSFC
  * ExplodedAssembly
  * Assembly3 0.12.2
  * sheetmetal 0.4.2
  * fcgear 1.0.0
  * OpenDark 2023.12.17
  * fasteners
  * Help 1.0.3

Addon Icons greyed out

After générating a BOM file, not always, but very ofter the ICons become grey and I have no option to get them active again but to quit freead and restart

This has happened since version .5 but forgot to mention it, surely I am doing something wrong

Startup error

The WB starts fine with the 0.22 development of FreeCAD (0.22.0dev.35594) but not with earlier versions (<0.21). It gives the following error:

During initialization the error "UI file does not exist" occurred in /home/hubertz/.local/share/FreeCAD/Mod/BillOfMaterials/./InitGui.py
Please look into the log file for further information

I think it's not finding PATH_TB = os.path.dirname(getsourcefile(lambda:0)) . In Assembly4 I use the following code which works with all versions of FreeCAD:

import Asm4_locator
Asm4_path = os.path.dirname( Asm4_locator.__file__ )

The file Asm4_locator.py is an empty file

Extra columns, shape length, width and height : do not respect system decimal settings

Numbers are always exported with a decimal point. In France we use the comma as a decimal separator, so when copy/pasting to a spreadsheet (libreoffice) number are treated as text, not numbers

As an aside - not sure if it should be changed, if the result comes from a calculation (I guess), there are plenty of digits after the decimal point, otherwise they are integers.

I am sure you'll start to hate me at some point ^^

Assembly type mis detection

I installed this workbench this morning and using Create Overall BOM (the other two do nothing) BOM Workbench insists that my assembly was not made with A2Plus but MultiBody Not sure if this has consequences on the BOM generated

Cannot generate BOM

I tried to generate BOM but whatever I try I get the same output
I am on Linux Mint Cinnamon 21.3
When I try to change CreatedBy = os.getlogin() to any fixed string I get the same error?

12:13:49  Traceback (most recent call last):
12:13:49    File "/home/tdarlic/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/BillOfMaterials/./Load_BoM_Panel.py", line 269, in on_CreateBOM_clicked
12:13:49      GetBOM_AppPart.BomFunctions.Start(
12:13:49    File "/home/tdarlic/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/BillOfMaterials/./GetBOM_AppPart.py", line 646, in Start
12:13:49      raise e
12:13:49    File "/home/tdarlic/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/BillOfMaterials/./GetBOM_AppPart.py", line 628, in Start
12:13:49      self.CreateTotalBoM(
12:13:49    File "/home/tdarlic/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/BillOfMaterials/./GetBOM_AppPart.py", line 406, in CreateTotalBoM
12:13:49      General_BOM.createBoMSpreadsheet(TemporaryList)
12:13:49    File "/home/tdarlic/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/BillOfMaterials/./General_BOM_Functions.py", line 309, in createBoMSpreadsheet
12:13:49      CreatedBy = os.getlogin()
12:13:49                  ^^^^^^^^^^^^^
12:13:49  OSError: [Errno 25] Inappropriate ioctl for device

No option to "explode" an array into individual elements

When, in A2Plus, importing an array of objects, the BOM list the array as one single element, which makes the BOM feel wrong, especially when the width, length and pad will be evaluated the calculation one could derive from these values will be off by possibly a long way

Not knowing the internals of Freecad I don't know if it would be feasible or not to explode an array into it's component elements or if there would be a work around

Edit: I was thinking may be just extracting the length of the array could go a long way into mitigating what I see as an issue (does not mean everybody would), mays be as an extra column, defaulting to 1; if it is not an array

No module named 'PySide6'

after fixing the PATH_TB , the workbench loads fine, but can't execute any function because :

Running the Python command 'CreateBOM_Overall' failed:
Traceback (most recent call last):
File "/home/hubertz/.local/share/FreeCAD/Mod/BillOfMaterials/./BoM_Commands.py", line 295, in Activated
import Load_BoM_Panel
File "/usr/lib/python3/dist-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "/home/hubertz/.local/share/FreeCAD/Mod/BillOfMaterials/./Load_BoM_Panel.py", line 31, in <module>
import BoM_ManageColumns
File "/usr/lib/python3/dist-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "/home/hubertz/.local/share/FreeCAD/Mod/BillOfMaterials/./BoM_ManageColumns.py", line 36, in <module>
import Resources.UI.Add_RemoveColumns_ui as Add_RemoveColumns_ui
File "/usr/lib/python3/dist-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)
File "/home/hubertz/.local/share/FreeCAD/Mod/BillOfMaterials/./Resources/UI/Add_RemoveColumns_ui.py", line 11, in <module>
from PySide6.QtCore import (
File "/usr/lib/python3/dist-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
return original_import(name, *args, **kwargs)

No module named 'PySide6'

and I see that PySide6 is called in quite many places so I can't easily fix them

Can only run "Create overall BOM" and "Add or remove columns" commands

I can only run the "Create overall BOM" and "Add or remove columns" commands successfully. All others fail with a similar error:

Running the Python command 'CreateBOM_Raw' failed:
Traceback (most recent call last):
  File "/$HOME/snap/freecad/common/Mod/BillOfMaterials/./BoM_Commands.py", line 247, in Activated
    from General_BOM_Functions import CheckAssemblyType

cannot import name 'CheckAssemblyType' from 'General_BOM_Functions' ($HOME/snap/freecad/common/Mod/BillOfMaterials/./General_BOM_Functions.py)
Running the Python command 'CreateBOM_1stLevel' failed:
Traceback (most recent call last):
  File "$HOME/snap/freecad/common/Mod/BillOfMaterials/./BoM_Commands.py", line 198, in Activated
    from General_BOM_Functions import CheckAssemblyType

cannot import name 'CheckAssemblyType' from 'General_BOM_Functions' ($HOME/snap/freecad/common/Mod/BillOfMaterials/./General_BOM_Functions.py)

My system details:

OS: Ubuntu Core 22 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36017 (Git) Snap 931
Build type: Release
Branch: main
Hash: 5763ac32b0dd8ac574b791f857eeec0d9d17a4f0
Python 3.10.12, Qt 5.15.10, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.1
Installed mods: 
  * BIM 2021.12.0
  * Curves 0.6.23
  * ExplodedAssembly
  * BillOfMaterials 0.0.5.1
  * Ondsel-Lens 2024.1.22.01
  * Assembly4 0.50.7

No module named openpyxl

I can now launch the BoM WB, but not use it :

cannot import name 'CheckAssemblyType' from 'General_BOM_Functions' 
Traceback (most recent call last):
...
ModuleNotFoundError: No module named 'openpyxl'

Question regarding sub assemblies

In a2Plus, the subassembly content is listed fine, identified by a number with a dot in it, that works really well, but the subassembly itself is also listed, which confuses the reader, and makes it a bit difficult to read / understand, may be an option to list or not the subassembly. what do you think ?

This is in the full BOM list

A2Assembly, path incorrect when generating the BOM File

I wanted to check if importing a sub assembly woud work when creating a BOM.
I creatd the sub assemply in a sub sirectory, for practical reasons, A2plus, does not complain and it's parts list is fine.

But when generating the BOM list I get the following

16:02:05 File '/home/didier/Bureau/Cuisine/tiroir_assembly.FCStd' does not exist!
16:02:05 Traceback (most recent call last):
16:02:05 File "/home/didier/.local/share/FreeCAD/Mod/BillOfMaterials/./Load_BoM_Panel.py", line 286, in on_CreateBOM_clicked
16:02:05 GetBOM_A2plus.BomFunctions.Start(
16:02:05 File "/home/didier/.local/share/FreeCAD/Mod/BillOfMaterials/./GetBOM_A2plus.py", line 723, in Start
16:02:05 raise e
16:02:05 File "/home/didier/.local/share/FreeCAD/Mod/BillOfMaterials/./GetBOM_A2plus.py", line 701, in Start
16:02:05 self.GetTreeObjects(checkAssemblyType=CheckAssemblyType)
16:02:05 File "/home/didier/.local/share/FreeCAD/Mod/BillOfMaterials/./GetBOM_A2plus.py", line 74, in GetTreeObjects
16:02:05 self.GoThrough_Objects(
16:02:05 File "/home/didier/.local/share/FreeCAD/Mod/BillOfMaterials/./GetBOM_A2plus.py", line 179, in GoThrough_Objects
16:02:05 ObjectDocument = App.openDocument(FullPath, True)
16:02:05 OSError: File '/home/didier/Bureau/Cuisine/tiroir_assembly.FCStd' does not exist!

It is normal, that file does not exists, it is in /home/didier/Bureau/Cuisine/tiroir/tiroir_assembly.FCStd, notice the missing tiroir subdirectory

If that helps, I am happy to provide a new set of files

WB icon

Dear Paul,

I downloaded but didn't yet test your WB. It is really welcome because I've been struggling with this function in Assembly4 since ever, therefore I hope you can make it work well.

I have only a little comment: are you sure the icon of this WB is well chosen ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.