You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
I am having the same issue. If I switch my units to decimal (mm) it will export, but with really strange dimensions in the csv. I tried to modify the code but must not have done it correctly. I'm assuming it's a Fusion 360 update that caused the issue, since the installation tutorial is no longer accurate (menu location, as well as I had to select the entire folder and not simply the .py file).
newellista
pushed a commit
to newellista/CSV-BOM
that referenced
this issue
Apr 22, 2021
to a float, by parsing the string, converting the pieces and converting
the pieces to a float.
Shout out to @sowings13 and @loganhnry for the diagnosis and reporting
it in macmanpb#2
This will resolvemacmanpb#2
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:
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:
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!
The text was updated successfully, but these errors were encountered: