<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to Programmatically Save a Sketch as DXF in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-to-programmatically-save-a-sketch-as-dxf/m-p/7103224#M18095</link>
    <description>&lt;P&gt;Hello, I am having trouble trying to save a selected sketch into a DXF file. I am using the .saveAsDXF(filename) function but it is not working. How do I save a selected sketch into a DXF file then?&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2017 22:22:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-05-23T22:22:25Z</dc:date>
    <item>
      <title>How to Programmatically Save a Sketch as DXF</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-to-programmatically-save-a-sketch-as-dxf/m-p/7103224#M18095</link>
      <description>&lt;P&gt;Hello, I am having trouble trying to save a selected sketch into a DXF file. I am using the .saveAsDXF(filename) function but it is not working. How do I save a selected sketch into a DXF file then?&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 22:22:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-to-programmatically-save-a-sketch-as-dxf/m-p/7103224#M18095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-23T22:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to Programmatically Save a Sketch as DXF</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-to-programmatically-save-a-sketch-as-dxf/m-p/7105251#M18096</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you install &lt;STRONG&gt;Fusion&lt;/STRONG&gt; from the &lt;STRONG&gt;Mac App Store&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;In that case &lt;STRONG&gt;Fusion&lt;/STRONG&gt; is running inside a &lt;STRONG&gt;sandbox&lt;/STRONG&gt; which makes it tricky to write to folders outside the sandbox folder structure.&lt;/P&gt;
&lt;P&gt;If you write inside the sandbox area then that should succeed, e.g.:&lt;/P&gt;
&lt;PRE&gt;# select a sketch and run the code, make sure you change user name in the folder path
import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        #design = adsk.fusion.Design.cast(app.activeProduct)
        sketch = adsk.fusion.Sketch.cast(ui.activeSelections.item(0).entity)
        success = sketch.saveAsDXF("/Users/&amp;lt;user name&amp;gt;/Library/Containers/com.autodesk.mas.fusion360/Data/Library/Application Support/mydxf.dxf")
        wasitsuccessful = success

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 14:10:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/how-to-programmatically-save-a-sketch-as-dxf/m-p/7105251#M18096</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2017-05-24T14:10:59Z</dc:date>
    </item>
  </channel>
</rss>

