I want a script in python3 with QGISPyQGIS 3?
. For example:
This code createcreates a layout 2019_A4"2019_A4" and addadds Layout Manager. I need a code to make the same in QGIS3QGIS 3 using the QgsLayoutManagerQgsLayoutManager
with Methodsthe duplicateLayoutduplicateLayout
method.
Here: https://qgis.org/pyqgis/3.4/core/QgsLayoutManager.html
from qgis.PyQt.QtCore import *
from qgis.core import *
# A Project, Manager, & PrintLayout Classes
project = QgsProject.instance()
manager = project.layoutManager()
# layout = QgsPrintLayout(project)
layout = manager.layoutByName("2019_A4")
#layout.initializeDefaults()
#layout.setName('2019_A')
manager.addLayout(layout)
from qgis.PyQt.QtCore import *
from qgis.core import *
# A Project, Manager, & PrintLayout Classes
project = QgsProject.instance()
manager = project.layoutManager()
# layout = QgsPrintLayout(project)
layout = manager.layoutByName("2019_A4")
#layout.initializeDefaults()
#layout.setName('2019_A')
manager.addLayout(layout)