pettijohn / csv-bom-plus Goto Github PK
View Code? Open in Web Editor NEWThis project forked from macmanpb/csv-bom
Creates a bill of material from the browser components tree in Autodesk Fusion360.
License: MIT License
This project forked from macmanpb/csv-bom
Creates a bill of material from the browser components tree in Autodesk Fusion360.
License: MIT License
When trying to write a BOM in Fusion 360 2.0.9313 for windows 10 X64, I was getting encoding errors. I was able to fix the problem locally with adding "encoding='utf-8'" to the open argument (CSV_BOM_Core.py:118). Don't know if this is an issue with my PC or a broader issue but I figured I'd post it here just in case.
UnitsManager.formatInternalValue not properly adjusting for General Precision as set in User Preference. It's a known issue. F360 stores data as CM and CVS-BOM converts it back to Inches if that's your working unit of measure, but the conversion is off just a little. For example, 20 inches is converted to 19.9999997 and output as the same instead of being rounded to based on your defined preference.
The solution is simple, but it might not be worth adding if they plan on fixing the function. If somebody needs it like I did, they can update their code with the following changes. I did not test this fix with any other units of measure like ft, cm, mm, inches with fractions.
Before getting to my code, I wanted to thank pettijohn for sharing his work and some nicely documented and structured code. It make researching this fix so much easier for someone who has never coded in python before.
Add the following lines after app is defined in CSV_BOM_Plus.py after ui is defined. It pulls the general precision value from preferences. You can do this using the edit command from the add-ins window.
genPrecision = app.preferences.unitAndValuePreferences.generalPrecision
Then update the lines
"x": maxPointX - minPointX,
"y": maxPointY - minPointY,
"z": maxPointZ - minPointZ
to be as follows
"x": round(maxPointX - minPointX, genPrecision),
"y": round(maxPointY - minPointY, genPrecision),
"z": round(maxPointZ - minPointZ, genPrecision)
This will round the height, width and length to reflect the General Precision setting you have defined in your preferences.
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.