You are right Jeff H. But my experience with first simple coding till it works and after that finetuning, unfortunately the finetuning part will be skipped. Time, costs, that kind of things
But with the information which is provided here by all these smart guys here, I am able to get new and better ideas to get to a solution. It is still not easy what is the best way. If I iterate each object and put it in a dictionary I have an overload because I don't need objects on layers that are off or frozen, I also don't need objects like dimensions, objects on layouts, and all objects with an objectid but no visible presentation.
But if I work with selection sets per layer and check each selected object to see what type it is and if it is a block, which block it is, I have the feeling I can do things much easier. But after trying all the ideas here in this topic I might conclude that selection sets are the best way for me.
Using LinQ might be a solution but I have to read more about that and do some tests to see how it works.
At least I got some new and interesting ideas and if I can't use it now, I will use it somewhere in the future