How to create a scene from a branch using script?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Olaf007

Hello guys,
I would like to create a plugin changing a couple of things in the engines viewport. The normal tools which exist for changing the windows and stuff are not enough.
This is why I would like to create a scene from the get_editor_interface().get_base_control(), so I could directly change some nodes in the editor.
How can I visualise the structure?
So I do not want to save a scene or one node. I would like to make a scene out of the parent node and all the children nodes. - Exactly the thing that happens using the “Make scene from branch” button in the scene view.