Level of detail with linked models


Is it possible to generate LoD for all models from scene which are linked (on example icon like on the screen below)?

I mean creating and controling LoD only with code.

EDIT: I just want get geometries from that linked models and call LoD