Dynamically Change Parent of Group

Hi there,

Is there a way to dynamically change the parent of a group through scripting?

Many thanks.