This code fragment
Code: Select all
namedView = self.document.getroot().find(inkex.addNS('namedview', 'sodipodi'))
if namedView is not None:
documentUnits = inkex.addNS('document-units', 'inkscape')
print >> sys.stderr, namedView.get(documentUnits)
namedView.set(documentUnits, "mm")
print >> sys.stderr, namedView.get(documentUnits)
prints
when run. But, Shift-F6 still reports in 'px' and, if I then save the file, I see inkscape:document-units="px" under sodipodi:namedview in the XML.px
mm
So my code seems to be changing the units, but the change doesn't stick. Any ideas? Thanks!