Re extrim in the Extrim.lsp program its called via (Etrim look for it, I use a small offset then use that for the Etrim select.
(etrim (entlast) (getvar 'extmax))
So this cuts the objects touching but does not remove the outside objects so the answer is change the inside objects to a dummy layer isolate the outside objects layer then delete them, unisolate and change the objects back to correct layer.
Sequence is pick pline, pick 2 outside points ie window all the objects, this is used later for the erase out side objects.
Waffles.lsp