<div dir="ltr"><div dir="ltr">Dear all,<div>I am trying to create a map from qgis. I have added a few layers and created a layout in qgis. All I want is to create a script to get a map from the layer on the layout that I have created in qgis. I have attached the code. I am thinking of activating each layer at a time so that only the activated layer will be on the layout and a map will get generated. While trying to activate with iface.setactivelayer I am facing an error. So no layer is added to the layout. I have added the codeĀ  and image of the generated map.</div><img src="cid:ii_lptajjg92" alt="Day-1.png" width="163" height="216" style="margin-right: 0px;"><br><div><br></div><div><img src="cid:ii_lptadrgf1" alt="image.png" width="216" height="47" style="margin-right: 0px;"><br></div><div><br></div><div><div>How to access the layer in qgis? how to deactivate the first layer and then move to the next layer for the next map.</div></div><div><br></div><div>Regards,</div><div>Noshin</div></div></div>