SERIOUS problem with ENTNEXT
A very serious problem exists with ENTNEXT.
Try the following:
Start BricsCAD with an empty drawing. Before doing anything else switch to Layout1. BricsCAD automatically creates a viewport entity there. Switch back to Model. Draw a circle. Enter (setq en (entlast)) - you can test that the last entity is stored in en with (entget en).
Now type (entget (entnext en)). Since en is the last entity in the drawing base, (entnext en) should return nil. However: in BricsCAD (entnext en) returns the viewport entity.
Even worse: when you have created other objects in paperspace of Layout1, then (entget (setq en (entnext en))) would return all of these layout-objects despite the fact that they have been drawn BEFOR the circle.