Automatically implement the OnDemandLoad = True of geometry elements

Hi!
I have an idea: I want to improve the VC geometry performance. I tried to change the python script to automatically implement the OnDemandLoad = True of geometry elements, but there is something wrong with mine. In" MachineA", it is ok, but in “MachineB”, it seems to be unable to find, including geometry elements in the links,


The python script:
OnDemandLoadFeatures.zip (6.7 MB)

Can you help me?

Thank you very much!