8000 exported dxf is not readable by dxf2dwg (libreDWG) · Issue #186 · dxfjs/writer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
exported dxf is not readable by dxf2dwg (libreDWG) #186
Open
@pcace

Description

@pcace

Hi there, there seems to be some issue with the exported dxf with wrong class definitions.

when i generate a dxf like this:

const dxf = new DxfWriter()

// Set AutoCAD 2000 format and configuration
dxf.setVariable('$ACADVER', { 1: 'AC1009' }) // AutoCAD 2000 format
dxf.setVariable('$ATTMODE', { 70: 2 }) // Attribute display mode

// Set units to meters (common for GIS data)
dxf.setUnits(Units.Meters


const vertices = coordinates.map((coord) => ({
  point: point2d(coord[0], coord[1]),
}))

// Add lightweight polyline
dxf.addLWPolyline(vertices)

const dxfContent = dxf.stringify()

i get a dxf file what generates the following error when converting it to a dwg:

ogre@d468da10d566:/tmp/ogre-uploads$ dxf2dwg -v9 eea2e2f4a5427ea23590c4c9b083ff55.dxf 
Reading DXF file eea2e2f4a5427ea23590c4c9b083ff55.dxf
  ADD_OBJECT BLOCK_HEADER [0]
object_map{1F} = 0
[add handleref (4.2.1) abs:1]   dxf (0, "SECTION")
  dxf (2, "HEADER")
  dxf (9, "$ACADVER")
  dxf (1, "AC1009")
HEADER.from_version = AC1009,   dat->from_version = AC1009
HEADER.version = AC1015,        dat->version = AC1015
  dxf (9, "$LASTSAVEDBY")
  dxf (1, "@tarikjabiri/dxf")
SUMMARY.LASTSAVEDBY = @tarikjabiri/dxf [T16 1]
  dxf (9, "$HANDSEED")
  dxf (5, 7F)
[add handleref (4.2.7F) abs:127] HEADER.HANDSEED 7F [H 5]
  dxf (9, "$INSUNITS")
  dxf (70, 6)
HEADER.INSUNITS [BS 70]
  dxf (9, "$CLAYER")
  dxf (8, "0")
HEADER.CLAYER 0 [H 8] later
  dxf (9, "$ATTMODE")
  dxf (70, 2)
HEADER.ATTMODE [BS 70]
  dxf (9, "$VIEWCTR")
  dxf (10, 13.431954)
HEADER.VIEWCTR [3RD 10][0] = 13.431954
  dxf (20, 52.505348)
HEADER.VIEWCTR [3RD 20][1] = 52.505348
  dxf (0, "ENDSEC")
dxf_fixup_header
default HEADER.codepage = 30 [ANSI_1252]
  dxf (0, "SECTION")
  dxf (2, "CLASSES")
  dxf (0, "ENDSEC")
ERROR: 2 CLASSES must be followed by 0 CLASS
ERROR: Failed to decode DXF file: eea2e2f4a5427ea23590c4c9b083ff55.dxf

READ ERROR 0x800 eea2e2f4a5427ea23590c4c9b083ff55.dxf

since it can normally convert dxf pretty reliable, i guess there is something wrong with my code or the library.

if you have any idea how to fix this issue id be very happy to hear it :)

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0