Maybe you are using routine to grab data which isn't designed for that entities... Using routine where you have specified (ssget '((0 . "LWPOLYLINE))) on entity that is 3d polyline or old heavy 2d polyline, will select nothing... Also using routine where you have specified (ssget '((0 . "POLYLINE"))) on entity lwpolyline, will also select nothing... Please use appropriate routine on appropriate entities, or combine your 2 routines into one that will operate on every entity, but you must specify that in appropriate (ssget '((0 . "*POLYLINE"))) filter...