I don't think you need to check if the block is anonymous, because I don't think a layout could have an anonymous block associated with it.
I'm not sure if you would need to check if the block has been erased either, as it might not be in the layout dictionary, but a quick test could be done. Just create a layout, and run the code. Then delete the layout, and run the code. Then you should be able to tell if the layout information is still in the dictionary.
We (me) did that already Tim.... and you right.
thanks! to refresh my 3 brain cells... left
My pleasure Luis. You probably forgot more about programming that I will ever know.