summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2012-03-26 21:40:56 +0000
committerapenner <penner@vaxxine.com>2012-03-26 21:40:56 +0000
commita444cc1e0db05c7cce6f9a9b20327f6abbe3f56a (patch)
treef089534dad0b9b140a3675755ecc392d3e4ed200 /share/extensions
parentpowerstroke: spiro join: more robust detection of tangent direction. fixes in... (diff)
downloadinkscape-a444cc1e0db05c7cce6f9a9b20327f6abbe3f56a.tar.gz
inkscape-a444cc1e0db05c7cce6f9a9b20327f6abbe3f56a.zip
cutting plotter dxf export. patch by Yann Papouin to allow hiding invisible layers (Bug 959159)
Fixed bugs: - https://launchpad.net/bugs/959159 (bzr r11130)
Diffstat (limited to 'share/extensions')
-rw-r--r--share/extensions/dxf_outlines.inx4
-rwxr-xr-xshare/extensions/dxf_outlines.py8
2 files changed, 11 insertions, 1 deletions
diff --git a/share/extensions/dxf_outlines.inx b/share/extensions/dxf_outlines.inx
index b0782bcb5..ccc660181 100644
--- a/share/extensions/dxf_outlines.inx
+++ b/share/extensions/dxf_outlines.inx
@@ -25,6 +25,7 @@
<_item value="cp1252">CP 1252</_item>
<_item value="utf_8">UTF 8</_item>
</param>
+ <param name="visibleLayers" type="boolean" _gui-text="keep only visible layers">true</param>
</page>
<page name="help" _gui-text="Help">
<_param name="inputhelp" type="description" xml:space="preserve">- AutoCAD Release 14 DXF format.
@@ -34,7 +35,8 @@
- rectangles
- clones (the crossreference to the original is lost)
- ROBO-Master spline output is a specialized spline readable only by ROBO-Master and AutoDesk viewers, not Inkscape.
-- LWPOLYLINE output is a multiply-connected polyline, disable it to use a legacy version of the LINE output.</_param>
+- LWPOLYLINE output is a multiply-connected polyline, disable it to use a legacy version of the LINE output.
+- You can choose to export all layers or only visible ones</_param>
</page>
</param>
<output>
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index 3f5f15b4d..a5ff0f012 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -76,6 +76,8 @@ class MyEffect(inkex.Effect):
type="string", dest="tab")
self.OptionParser.add_option("--inputhelp", action="store",
type="string", dest="inputhelp")
+ self.OptionParser.add_option("--visibleLayers", action="store",
+ type="string", dest="visibleLayers")
self.dxf = []
self.handle = 255 # handle for DXF ENTITY
self.layers = ['0']
@@ -248,6 +250,12 @@ class MyEffect(inkex.Effect):
def process_group(self, group):
if group.get(inkex.addNS('groupmode', 'inkscape')) == 'layer':
+ style = group.get('style')
+ if style:
+ style = simplestyle.parseStyle(style)
+ if style.has_key('display'):
+ if style['display'] == 'none' and self.options.visibleLayers == 'true':
+ return
layer = group.get(inkex.addNS('label', 'inkscape'))
layer = layer.replace(' ', '_')
if layer in self.layers: