Skip to content

Commit

Permalink
set document grid and show border on top
Browse files Browse the repository at this point in the history
  • Loading branch information
badgeek committed Apr 2, 2018
1 parent d97ba1f commit cd349b3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions inkscape/prepare_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,26 @@ def prepareDocument(self):
if ("Drill" not in layers):
self.createLayer("Drill")

def setDocumentGrid(self):
doc_view = self.document.xpath('//sodipodi:namedview',namespaces=inkex.NSS)[0]
doc_view.attrib['borderlayer'] = "true"
doc_view.attrib['showgrid'] = "true"

grid = inkex.etree.Element(inkex.addNS('grid','inkscape'))
grid.set('spacingx', '2.54')
grid.set('spacingy', '2.54')
grid.set('empspacing', '1')
grid.set('type', 'xygrid')
grid.set('units', 'mm')

doc_view.append(grid)

def effect(self):
self.setDocumentSquare(self.options.docwidth)
self.setInkscapeScaling()
self.prepareDocument()

self.setDocumentGrid()


def export_layers(self, dest, show):
"""
Expand Down

0 comments on commit cd349b3

Please sign in to comment.