What is the best way to virtual-ize all sub-assemblies inside of my parent assembly?

I have many large assemblies that contain parts, sub assemblies, and parts within sub-assemblies. This can be several layers deep.

I wish to make everything inside of this assembly virtual, but I am unable to select everything in the feature tree and then right mouse click to "make virtual".

I find myself instead selecting the children of the lowest sub assemblies, and making them virtual, then their parent assembly, and slowly work my way up the assembly tree. This is both time consuming and error prone.

Is there a button to click or a process to follow that will allow me to virtualize everything in a single process? Perhaps there is a macro or API code?

I would prefer to not dissolve the sub assemblies.

We are finding this to be a much needed capability.

Thank you.

SolidworksApi macros