<div dir="ltr"><div>Hi Abdelghani,</div><div><br></div><div>You should be able to achieve that by setting the project's terrain:</div><div>```</div><div>p=QgsRasterDemTerrainProvider()<br>p.setLayer(dem_layer)<br>QgsProject.instance().elevationProperties().setTerrainProvider(p)</div><div>```</div><div>This should get your dem_layer as a terrain for any new 3d views.</div><div>I don't think the API to change the 3d views' terrain is exposed to python yet.</div><div><br></div><div>Best</div><div>Stefanos<br></div></div>