I'm a real beginner in Python. I'm using a Python script to produce maps automatically.
This script is working but it is failing in the last part: saving the current map with a specific print layout. Im using the "Maps Printer" Plugin to do this.
The code bellow worked in QGIS 2.18 but fail in Qgis 3.8.
# Your settings
composerTitle = 'Composer_001' # Name of the composer you want to export
folder = 'C:/Users/.../'
extension = '.jpeg' # Any extension supported by the plugin
titre = 'NomCarte'
mp = qgis.utils.plugins['MapsPrinter']
for composer in iface.activeComposers():
title = composer.composerWindow().windowTitle()
if title == composerTitle:
mp.exportCompo( composer, folder, titre, extension )
break
The command iface.activeComposers
seems to not work anymore in QGIS 3.0.
Does anyone have an idea to solve this problem?