diff --git a/stitchcode/gui.js b/stitchcode/gui.js index f3a57b35..1f163684 100644 --- a/stitchcode/gui.js +++ b/stitchcode/gui.js @@ -1404,6 +1404,14 @@ IDE_Morph.prototype.createStatusDisplay = function () { ignoreColorsButton.newLines = 1.7; elements.push(ignoreColorsButton); + var downloadDXFButton = new PushButtonMorph( + null, + function () { myself.downloadDXF(); }, + 'Export as DXF' + ); + downloadDXFButton.newLines = 1.7; + elements.push(downloadDXFButton); + var downloadEXPButton = new PushButtonMorph( null, function () { myself.downloadEXP(); }, @@ -1515,6 +1523,13 @@ IDE_Morph.prototype.downloadSVG = function() { saveAs(blob, (this.projectName ? this.projectName : 'turtlestitch') + '.svg'); }; +// DXF export +IDE_Morph.prototype.downloadDXF = function() { + dxfStr = this.stage.turtleShepherd.toDXF(); + blob = new Blob([dxfStr]); + saveAs(blob, (this.projectName ? this.projectName : 'turtlestitch') + '.dxf'); +}; + // EXP export IDE_Morph.prototype.downloadEXP = function() { expUintArr = this.stage.turtleShepherd.toEXP(); @@ -1960,6 +1975,11 @@ IDE_Morph.prototype.projectMenu = function () { function() { myself.downloadSVG(); }, 'Export current drawing as SVG Vector file' ); + menu.addItem( + 'Export as DXF', + function() { myself.downloadDXF(); }, + 'Export current drawing as DXF file' + ); menu.addItem( 'Export as PNG', function() { myself.downloadPNG(); },