Closed Colatino closed 2 years ago
When I add any number of DimStyles, the generated DXF document won't open on AutoCAD.
Inspecting the file I've found that there is an AcDbDimStyleTable subclass before each DIMSTYLE and this is causing the error.
As a workaround I changed the DxfDimStyle and DxfTable classes.
The DxfDimStyle class I commented this line:
dx.subclassMarker('AcDbDimStyleTable');
And on the DxfTable:
class DxfTable { constructor(name) { this.name = name; this.maxNumberEntries = 0; this.ownerObjectHandle = '0'; this.handle = Handle.next(); this.records = []; } dxify(dx) { dx.type('TABLE'); dx.name(this.name); dx.handle(this.handle); dx.push(330, this.ownerObjectHandle); dx.subclassMarker('AcDbSymbolTable'); dx.push(70, this.records.length); // Added this IF clause to ensure only one AcDbDimStyleTable if (this.name == "DIMSTYLE") { dx.subclassMarker('AcDbDimStyleTable'); } for (const record of this.records) record.dxify(dx); dx.type('ENDTAB'); } }
This change allowed me to open the files on AutoCAD
Hi, Thank you for the report, you are right and its fixed in v2.3.5. Regards.
When I add any number of DimStyles, the generated DXF document won't open on AutoCAD.
Inspecting the file I've found that there is an AcDbDimStyleTable subclass before each DIMSTYLE and this is causing the error.
As a workaround I changed the DxfDimStyle and DxfTable classes.
The DxfDimStyle class I commented this line:
And on the DxfTable:
This change allowed me to open the files on AutoCAD