-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
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!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels