My level is generated by code can i make a BSP tree for entitys created with script (ent_create)?

with my.eflags |= CLIP0; i have mor fps but if I'm locking at a wall and I do see only the wall, the tab menue call me there are 3000 visible entitys, how can I chose erea for turn on off the visible?