There is such a code:
from PyQt4.QtCore import QVariant
from qgis.core import (QgsFeature, QgsField, QgsFields,
QgsGeometry, QgsPoint, QgsVectorFileWriter)
from qgis.utils import QGis, iface
iface.legendInterface().layers()
sluoksniu_saras=iface.legendInterface().layers()
for cL in sluoksniu_saras:
fn='D:\\Ko\\'+cL.name()
ret = QgsVectorFileWriter.writeAsVectorFormat(cL, fn, "Windows-1257",\
QgsCoordinateReferenceSystem(cL.crs()), driverName="ESRI Shapefile",\
forceMulti =False, includeZ = False)
if ret == QgsVectorFileWriter.NoError:
print "Irasyta i " +fn + " !"
print 'viskas'
In theory, he should write all open layers of the project in a specific folder and reset the z-dimension. Layers are recorded, but the z-dimension is not reset. Where is the mistake? I'm using QGIS 2.16