macmanpb / csv-bom Goto Github PK
View Code? Open in Web Editor NEWCreates a bill of material from the browser components tree in Autodesk Fusion360.
Creates a bill of material from the browser components tree in Autodesk Fusion360.
It is exporting the cylindrical bodies with wrong dimensions.
In fusion when right click, properties, the bounding box show the right dimensions (or projection) of the body.
I use fractional units (i.e. 1 1/2"), but if I try to generate a BOM that includes dimensions, I get the following error:
Failed:
Traceback (most recent call last):
File "CSV-BOM.py", line 540, in notify
csvStr = self.collectData(design, bom, prefs)
File "CSV-BOM.py", line 211, in collectData
dimX = float(design.fusionUnitsManager.formatInternalValue(item["boundingBox["x"], defaultUnit, False))
ValueError: could not convert string to float: '27 7/8'
I'm not a python developer, but a quick google search shows this as a way to convert fractions to decimals Convert Fraction to Float, and if I manually added that on lines 211-213 and 276-278, I was able to successfully generate the cut list. Here's what one line looked like:
dimX = float(sum(Fraction(s) for s in design.fusionUnitsManager.formatInternalValue(item["boundingBox"]["x"], defaultUnit, False).split()))
One downside is that just converts everything to decimals, so I have to then mentally convert back to fractional later when using it; ideally you'd have a better solution that automatically handled fractional units.
Otherwise, I really like your extension, thanks for making it!
Thanks so much for this! All the paid-for things are such a pain in the butt. This worked super well for me!
You are missing a donation link for me to give back in thanks.
Have made some modifications to make this work with MaxCut. Anybody interested?
Can the code be updated to extract each body from a component and include them in the BOM. As is, it' extracts the volume the multiple components represent rather than the individual bodies. For instance, a drawer is extracted as a box rather than 4 individual sides and a bottom.
Thanks.
I could definitely do the conversion but i'm missing a couple of decimal places when I do. I've changed the default units on Fusion from kg to g, but still get the info in Kg.
I tried adding the part number as a selectable option but I have limited exposure to python. The object does exists in the API documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.