Add pref for new Dxf Exporter

This commit is contained in:
wandererfan
2019-03-21 18:20:49 -04:00
committed by Yorik van Havre
parent 576ef73cc4
commit 0d60f6dc79
2 changed files with 24 additions and 3 deletions

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>506</width>
<height>647</height>
<width>649</width>
<height>773</height>
</rect>
</property>
<property name="windowTitle">
@@ -52,6 +52,19 @@
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_7">
<property name="text">
<string>Use legacy python exporter</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>dxfUseLegacyExporter</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Draft</cstring>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">

View File

@@ -1940,8 +1940,14 @@ def getStrGroup(ob):
def export(objectslist,filename,nospline=False,lwPoly=False):
"called when freecad exports a file. If nospline=True, bsplines are exported as straight segs. lwPoly=True is for OpenSCAD DXF"
readPreferences()
if not dxfUseLegacyExporter:
import Import
version = 14
if nospline:
version = 12
Import.writeDXFObject(objectslist,filename,version,lwPoly)
return
getDXFlibs()
if dxfLibrary:
global exportList
@@ -2307,6 +2313,7 @@ def readPreferences():
global dxfMakeBlocks, dxfJoin, dxfRenderPolylineWidth, dxfImportTexts, dxfImportLayouts
global dxfImportPoints, dxfImportHatches, dxfUseStandardSize, dxfGetColors, dxfUseDraftVisGroups
global dxfFillMode, dxfBrightBackground, dxfDefaultColor, dxfUseLegacyImporter, dxfExportBlocks, dxfScaling
global dxfUseLegacyExporter
dxfCreatePart = p.GetBool("dxfCreatePart",True)
dxfCreateDraft = p.GetBool("dxfCreateDraft",False)
dxfCreateSketch = p.GetBool("dxfCreateSketch",False)
@@ -2324,6 +2331,7 @@ def readPreferences():
dxfUseDraftVisGroups = p.GetBool("dxfUseDraftVisGroups",False)
dxfFillMode = p.GetBool("fillmode",True)
dxfUseLegacyImporter = p.GetBool("dxfUseLegacyImporter",False)
dxfUseLegacyExporter = p.GetBool("dxfUseLegacyExporter",False)
dxfBrightBackground = isBrightBackground()
dxfDefaultColor = getColor()
dxfExportBlocks = p.GetBool("dxfExportBlocks",True)