Mark last inserted node and auto scroll program tree

Hello community,

I’m setting up an URCap which is inserting nodes into the program tree by using the robots digital inputs. Now, if you insert, for example, Waypoints with the Polyscope UI always the last inserted node is marked and visible at the bottom of the screen.

I want the fresh nodes to be marked and visible, like with standard Polyscope functionality.
I can’t find any information how to realize this with my URCap. Can someone give me a hint how to implement this?

Thank you all in advance,
regards

Andreas