Added lineWeight support to dxf exporter
This PR exposes the ability to change the Line Weight of lines drawn in a particular layer. This is a feature that was added in DXF R2000 and is supported by other DXF libraries. Ex: https://ezdxf.readthedocs.io/en/stable/concepts/lineweights.html
The hope was to also make the DXF exporter in closer parity with the SVG exporter, specifically in terms of strokeWidth
@microsoft-github-policy-service agree
Wow, thank you so much! Is this backward compatible with older DXF versions?
To be honest, I'm not sure. According to a gemini result, DXF R2000 came out in March 1999, though it might be confusing DXF R2000 with AutoCAD 2000 and/or DWG 2000 (or maybe they all came out at the same time! I'm not sure). In either case, support for Line Weight seems fairly well established
Also, I think, I read some where that most DXF readers ignore codes that they don't recognize so it should be backwards compatible
Okay a bit more research and it seems DXF AC1015 is synonymous with DXF R2000, which indeed came out in March 1999.
See https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf (page 11)
Thanks for doing the research. I think then that we can remove enableLineWeight and just look for the existence of a lineWeight to add the header.
Sounds good. I can make the $LWDISPLAY header always enabled. Would that make sense? (1ac2c1a)
Looks like the DXF test is failing
Should be working with latest commit
Unfortunately, I was wrong. This solution doesn't work in all viewers. In TrueviewCAD, the generated dxf file is considered invalid. The fix isn't straightforward and requires very invasive changes. I'm going to close this PR.
Your diligence is appreciated, thanks!