Skip to content

Added lineWeight support to dxf exporter #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xavi-
Copy link

@xavi- xavi- commented May 27, 2025

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

@xavi-
Copy link
Author

xavi- commented May 27, 2025

@microsoft-github-policy-service agree

@danmarshall
Copy link
Contributor

Wow, thank you so much! Is this backward compatible with older DXF versions?

@xavi-
Copy link
Author

xavi- commented Jun 19, 2025

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

@xavi-
Copy link
Author

xavi- commented Jun 19, 2025

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)

@danmarshall
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants