Well I finished the script I needed and thought I'd post it here for posterety.
I needed a DXF with different layers and a better curve control of the output for CNC purposes, I found out that splines and CNC don't work well together so I still ended up parsing my splines into small line pieces which I exported. I also needed actual circles instead of the Polygon I got from the DXF library which I also added to the exporter. Following the seperate elements I wrote for my custom exporter bit, I hope pieces might be usefull to someone. It wont work as such but might help someone in the right direction.
Currently working on a way to get text in a dxf file almost finished with that, when done ill post it as well.
//Start each file with a heade, first declare an expDxf array, this header also makes 3 layers "0", "CuttingLayer" and "EngravingLayer"
void dxfHeader() {
expDxf = new String [27];
expDxf = new String [] {
"0", "SECTION", "2", "TABLES", "0", "TABLE", "2", "LAYER", "70", "6", "0", "LAYER", "2", "CuttingLayer", "70", "64", "62", "2", "6", "CONTINUOUS", "0", "LAYER", "2", "EngravingLayer", "70", "64", "62", "3", "6", "CONTINUOUS", "0", "ENDTAB", "0", "TABLE", "2", "STYLE", "70", "0", "0", "ENDTAB", "0", "ENDSEC", "0", "SECTION", "2", "ENTITIES", "0"
};
}
//end of dxf file
void dxfEnd() {
expDxf = expand(expDxf, expDxf.length+3 );
expDxf[expDxf.length-3] = "ENDSEC";
expDxf[expDxf.length-2] = "0";
expDxf[expDxf.length-1] = "EOF" ;
saveStrings("expChair.dxf", expDxf);
}
//im working with an array of curvepoints called slicePoints it has the x,y points of my curves z=0 in my case
void dxfLines(int x, int y, int curItteration) {
int oldLen = expDxf.length;
int newLen = (slicePoints.length/3*16)+expDxf.length-16;
expDxf = expand(expDxf, newLen );
for (int i =0; i < (slicePoints.length/3*16-16); i=i+16) {
expDxf [i+oldLen] = "LINE";
expDxf [i+oldLen+1] = "8";
expDxf [i+oldLen+2] = "CuttingLayer";
expDxf [i+oldLen+3] = "10";
expDxf [i+oldLen+4] = str(scaleFac*(slicePoints[3*i/16+1]+x));
expDxf [i+oldLen+5] = "20";
expDxf [i+oldLen+6] = str(scaleFac*(slicePoints[3*i/16+2]+y));
expDxf [i+oldLen+7] = "30";
expDxf [i+oldLen+8] = "0.0";//add z coordinate if u use it
expDxf [i+oldLen+9] = "11";
expDxf [i+oldLen+10] = str(scaleFac*(slicePoints[3*i/16+4]+x));
expDxf [i+oldLen+11] = "21";
expDxf [i+oldLen+12] = str(scaleFac*(slicePoints[3*i/16+5]+y));
expDxf [i+oldLen+13] = "31";
expDxf [i+oldLen+14] = "0.0";//add z coordinate if u use it
expDxf [i+oldLen+15] = "0";
}
}
//for drawing circles
void dxfCircle(int x, int y, int curItteration, float xco1, float yco1, float scaleRad, String layer) {
int oldLen = expDxf.length;
int newLen = (expDxf.length+12);
expDxf = expand(expDxf, newLen );
expDxf [oldLen] = "CIRCLE";
expDxf [oldLen+1] = "8";
expDxf [oldLen+2] = layer;
expDxf [oldLen+3] = "10";
expDxf [oldLen+4] = str(scaleFac*(xco1+x));
expDxf [oldLen+5] = "20";
expDxf [oldLen+6] = str(scaleFac*(yco1+y));
expDxf [oldLen+7] = "30";
expDxf [oldLen+8] = "0.0";
expDxf [oldLen+9] = "40";
expDxf [oldLen+10] = str(scaleFac * scaleRad);
expDxf [oldLen+11] = "0";
}