Right click object select export to snippet.
Mendix will create a snipit with that element and its children in.
Boom.
Yes please, I've been trying this too many times realizing everytime it doesn't work like that...