js-dxf
js-dxf copied to clipboard
Example output fails to open in AutoCAD 2021
Trying to open any file generated by this library in AutoCAD 2021 (for Mac) returns the following error:
Unknown group 74 for table on line 78.
Invalid or incomplete DXF input — drawing discarded.
This is true if I regenerate the file examples/demo.js.dxf
.
I'm having the same error even if using d.header('ACADVER', [[1, 'AC1009']])
Use generateAutocadExtras()
before toDxfString()
to fix this problem
Hi @thisismhp! We want to use this in ifc.js to allow users to export DXF files out of IFC files. We are successfully able to generate DXF files that can be read by several viewers (e.g. ODA dxf viewer), but unfortunately AutoCad won't load the output.
We've tried to use currentDrawing.generateAutocadExtras();
before const serialized = currentDrawing.toDxfString();
, but even then AutoCAD it's unable to load it. We've tried with AutoCAD 2017 and 2020. You can find the generated file here. It's the same as the image below but without the projected lines. You can also find the implementation we were working with here. It lacks currentDrawing.generateAutocadExtras();
, but we added that locally and still doesn't work.
Is there any code snippet that we can look that generates a drawing that AutoCAD can open?
Thanks in advance!
Hi,
The generateAutocadExtras()
is automatically called, you don't need to call it.
Try to find the entity causing the error, it is the line or polyline...