When I load the DWG, I got 5 layouts. For some reason the Entities collection for each of them except default is just 45. (For default is 29,000). When loading the same image in the demo view application, it loads correctly. The viewer shows all the items from the "Overal" layout and some entities from the default layout. When I hide all the entities in the viewer, only necessary items from the default layout are shown. Please, tell, how to get all the entities for the layout. The attachments shows my understanding of how to get them. It seems I'm wrong, but I cnnot find any additional explanation in the docs.
I'll really appreciate a code sample

FYI, I draw all the entities manually. I just need to know what entities to draw for the specified layout.
Thank you in advance,
Serge