>>Doesnt that give the same result? variable d is the parent and nobj is the nested object.
It certainly works. The reason I chimed in is that it didn't directly answer his question, which I interpreted to mean, "How to get the parent block given the nentsel return value?" I thought he could figure out how to obtain the layer from your example without further assistance but perhaps was assuming too much.
Your approach would have been another valid approach but if the person wants both the parent and the nested entity, only one call need be made, that to nentsel.