autocadpolylinedxf

How do I write a DXF code for a POLYLINE?


I´m trying to create a program based on C++ that calculates a function values on a given range and then the program proceeds to create a DXF file in order for it to be Graphed.

The issue that I´m having it´s with the DXF part this is the code that my C++ program generates but it seems to be unable to be read by Autocad. Any insights on the issue will be much appreciated.

0
SECTION
2
ENTITIES
0
POLYLINE
8
0
62
1
66
1
70
8
0
VERTEX
8
0
70
32
10
1
20
2
30
0
0
VERTEX
8
0
70
32
10
1.2
20
2.13688
30
0
0
VERTEX
8
0
70
32
10
1.4
20
2.28024
30
0
0
VERTEX
8
0
70
32
10
1.6
20
2.42929
30
0
0
VERTEX
8
0
70
32
10
1.8
20
2.58329
30
0
0
VERTEX
8
0
70
32
10
2
20
2.74166
30
0
0
91
0
0
SEQEND
0
ENDSEC
0
EOF


    

Solution

  • There is an error in the last VERTEX:

    0
    VERTEX
    8
    0
    70
    32
    10
    2
    20
    2.74166
    30
    0
    0    <---- This 0 is too much, starts a structural group tag (0, 91)
    91
    0
    0
    SEQEND
    0
    ENDSEC
    0
    EOF
    

    If you have any information what the group code 91 (vertex identifier) is for, let me know, I am very interested.