0

I need to create DXF files containing curves and spline. I am since long able to create simple DXF R12 File like this:

0
SECTION
2
ENTITIES
  0
POLYLINE
8
0
 66
     1
 10
0.0
 20
0.0
 30
0.0
 70
     0
 75
     6
 62
1
  0
VERTEX
  8
0
 10
1044.52
 20
825.596
 30
0.0
  0
VERTEX
  8
0
 10
1044.52
 20
700.099
 30
0.0
  0
SEQEND
0
ENDSEC
0
EOF

According to the DXF documentation (https://www.autodesk.com/techpubs/autocad/acad2000/dxf/polyline_dxf_06.htm and also http://paulbourke.net/dataformats/dxf/dxf10.html) even R12 POLYLINES can be given a "SPLINE" attribute, so i tried this:

0
SECTION
2
ENTITIES
  0
POLYLINE
8
0
 66
     1
 10
0.0
 20
0.0
 30
0.0
 70
     4
 62
1
  0
VERTEX
  8
0
 10
1044.52
 20
1825.596
 30
0.0
 70
     8
  0
VERTEX
  8
0
 10
644.52
 20
1025.596
 30
0.0
 70
     8
  0
VERTEX
  8
0
 10
544.52
 20
325.596
 30
0.0
 70
     8
  0
VERTEX
  8
0
 10
44.52
 20
25.596
 30
0.0
 70
     8
  0
VERTEX
  8
0
 10
1044.52
 20
700.099
 30
0.0
  0
SEQEND
0
ENDSEC
0
EOF

But this still shows only straight lines.

  1. Is it possible to create DXF Files with SPLINE content in DXF 12
  2. Can anybody point to SEIMPLE sample of how to create a spline in a DXF file
RED SOFT ADAIR
  • 12,032
  • 10
  • 54
  • 92

1 Answers1

1

Started with the information in https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/manually-writing-a-minimal-dxf/td-p/2081140

and was able to make a headerless, tableless file.dxf
which succesfully draws two lines

MinTwoLines.dxf

0
SECTION
2
ENTITIES
0
LINE
8
DXF_Lines_LayerName
10
0.0
20
0.0
30
0.0
11
1.0
21
0.0
31
0.0
0
LINE
8
DXF_Lines_LayerName
10
1.0
20
0.0
30
0.0
11
1.0
21
0.0
31
2.0
0
ENDSEC
0
EOF

Plopping a SPLINE ENTITY into the same location as the LINE failed.
so nabbed the splineA.dxf file from https://github.com/jscad/sample-files/blob/master/dxf/dxf-parser/splines.dxf and incrementally hacked off bits until no more could be successfully removed. The files resulting from laminating the below files can be successfully imported into Rhino 7.

The file lamination commands in Windows are:\

to make a single file with only the FourPoint spline
copy MinSplineHead.txt+FourPointSplineBody.txt+MinSplineTail.txt MinSpline.dxf

to make a single file with only the TwentyOnePoint spline
copy MinSplineHead.txt+TwentyOnePointSplineBody.txt+MinSplineTail.txt MinSpline.dxf

to make a single file with both splines
copy MinSplineHead.txt+FourPointSplineBody.txt+TwentyOnePointSplineBody.txt+MinSplineTail.txt MinSpline.dxf

MinSplineHead.txt

  0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1021
  0
ENDSEC
  0
SECTION
  2
TABLES
  0
TABLE
  2
LAYER
  5
2
330
0
100
AcDbSymbolTable
 70
    1
  0
LAYER
  5
10
330
2
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
  2
0
 70
    0
 62
    7
  6
CONTINUOUS
370
    0
390
F
  0
ENDTAB
  0
TABLE
  2
BLOCK_RECORD
  5
1
330
0
100
AcDbSymbolTable
 70
    2
  0
BLOCK_RECORD
  5
1F
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
  2
*Model_Space
 70
    0
280
    1
281
    0
  0
BLOCK_RECORD
  5
1E
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
  2
*Paper_Space
 70
    0
280
    1
281
    0
  0
ENDTAB
  0
ENDSEC
  0
SECTION
  2
ENTITIES

FourPointSplineBody.txt

  0
SPLINE
  8
DXF_Spline_LayerName
100
AcDbSpline
 70
    8
 71
    2
 72
    7
 73
    4
 74
    0
 42
1e-07
 43
1e-07
 40
0
 40
0
 40
0
 40
0.5
 40
1
 40
1
 40
1
 10
0
 20
0
 30
0
 10
122.4
 20
-38.5
 30
0
 10
77.5
 20
149.5
 30
0
 10
200
 20
100
 30
0

TwentyOnePointSplineBody.txt

  0
SPLINE
  8
DXF_Spline_LayerName
100
AcDbSpline
 70
     0
 71
     3
 72
    25
 73
    21
 74
     0
 42
0.00000
 43
0.00000
 40
0.0
 40
0.0
 40
0.0
 40
0.0
 40
0.02777
 40
0.05555
 40
0.08333
 40
0.11111
 40
0.13888
 40
0.16666
 40
0.19444
 40
0.22222
 40
0.25
 40
0.27777
 40
0.30555
 40
0.33333
 40
0.36111
 40
0.38888
 40
0.41666
 40
0.44444
 40
0.47222
 40
0.5
 40
0.5
 40
0.5
 40
0.5
10
7.000
20
-4.000
30
-5.500
10
7.288
20
-4.008
30
-5.492
10
7.955
20
-4.029
30
-5.416
10
8.881
20
-4.062
30
-5.168
10
9.750
20
-4.097
30
-4.763
10
10.535
20
-4.136
30
-4.213
10
11.213
20
-4.177
30
-3.535
10
11.763
20
-4.222
30
-2.750
10
12.168
20
-4.270
30
-1.881
10
12.416
20
-4.321
30
-0.955
10
12.500
20
-4.375
30
-0.000
10
12.416
20
-4.432
30
0.955
10
12.168
20
-4.492
30
1.881
10
11.763
20
-4.556
30
2.750
10
11.213
20
-4.622
30
3.535
10
10.535
20
-4.691
30
4.213
10
9.750
20
-4.764
30
4.763
10
8.881
20
-4.840
30
5.168
10
7.955
20
-4.918
30
5.416
10
7.288
20
-4.975
30
5.492
10
7.000
20
-5.000
30
5.500

MinSplineTail.txt

0
ENDSEC
0
EOF

teserecter
  • 461
  • 4
  • 13