Hey there,
As the Layout Tool has been completely redesigned the way to do this now is by using our Python Layout API
Notice that this API can run with a maya python only if required
Selected Entities can be fetched with the glmLayoutTool command:
Finally I attached a script which is fetching the selecting entities and adds a kill node to them
The result of those operations is concatenated in a Layout File (every time the script is called, the nodes are added to the files)
Here are the the doc of the two nodes in case that may help
Here's the generated result when calling it the first time on file A
And when called a second time still on file A
The generated Layout File has to be assigned to the relative CacheProxy to be taken into account at viewport time and at render time
I'll let you inspect the file and let us know if you have any questions :)
Stay safe,