Nice to see this for real world example.
It can be done by adding ' (single quote) before diameter in each diameter cell. It can be done in BOM program.
But, the problem is the cell content will be converted into string instead of FreeCAD Quantity object. And we will not be able to modify units after it is converted into string (Need to add = equal sign in cell at start before changing units).
If that thing is acceptable, then I will proceed to do above.
BTW, i think first I should complete its export to svg and we can cutomize this type of stuff during export like rounding diameter.
What is your opinion?
Unable to get this.
My mistake, I missed that for rebar2.
Now implemented as per commit: https://github.com/SurajDadral/FreeCAD- ... 433d689c12
Function to do so:
Code: Select all
def getRebarSharpEdgedLength(rebar): """getRebarSharpEdgedLength(Rebar): Returns sharp edged length of rebar object. """ base = rebar.Base # When rebar is drived from DWire if hasattr(base, "Length"): # When wire shape is created using DraftGeomUtils.filletWire() if not hasattr(base, "FilletRadius"): return base.Length # If FilletRadius of DWire is zero elif not base.FilletRadius: return base.Length else: edges = base.Shape.Edges if base.Closed: corners = len(edges) / 2 else: corners = (len(edges) - 1) / 2 extension_length = 2 * corners * base.FilletRadius rebar_straight_length = 0 for edge in edges[::2]: rebar_straight_length += edge.Length rebar_sharp_edged_length = ( FreeCAD.Units.Quantity(str(rebar_straight_length) + "mm") + extension_length ) return rebar_sharp_edged_length # When rebar is drived from Sketch elif base.isDerivedFrom("Sketcher::SketchObject"): rebar_length = 0 for geo in base.Geometry: rebar_length += geo.length() return FreeCAD.Units.Quantity(str(rebar_length) + "mm") else: print("Cannot calculate rebar length from its base object") return FreeCAD.Units.Quantity("0 mm")