<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi, I want to programmatically embed a project, like I can in the gui with "Layer>embed layers and groups."</div><div><br></div><div>I thought QgsProject.instance().createEmbeddedGroup() was what I needed, but it doesn't seem to work - see below.  Am I completely off track, or is it broken?</div><div><br></div><div>Thanks.</div><div><br></div><div>path='/home/alister/testtoembed.qgs'</div><div>project = QgsProject.instance()</div><div>project.read(path)</div><div>True</div><div>project.clear()</div><div>newGroup = QgsLayerTreeGroup()</div><div>type(newGroup)</div><div><class 'qgis._core.QgsLayerTreeGroup'></div><div>newGroup = QgsProject.instance().createEmbeddedGroup('test', path, [])</div><div>type(newGroup)</div><div><class 'NoneType'></div></div></div></div>