Of course that this is possible, but why such routine? And what if layer with such definition already exist in drawing and have many other entity types residing to it, wouldn't that be complication? So as many different blocks - as many different layers each containing corresponding block, what for...? Is it for QSELECT blocks - you can filter that inside filter of (ssget) - name of block... Why filter by attribute value, what can you achieve, count of such blocks with (sslength)? You already have dataextraction command, so you can see number of occurs and preview of complete data of blocks inside drawing...