SelectionSet count w/ 2 types = 44 time=2880
using this filter filter = new TypedValue[] { new TypedValue(0, "Line,Arc,Circle,ellipse"), new TypedValue(8, "0") };
Objectid count w/ 2 types selectall = 44 time=10740
using "Line,Arc,Circle,ellipse" and then selectall as I wrote then checking for layer 0
Objectid count w/ 2 types selectall2 = 44 time=10940
using "Line,Arc,Circle,ellipse" and then selectall as Daniel wrote then checking for layer 0
dictionary = 44 time=7900 Daniel's dictioary
dictionary = 44 time=7940 xsfhlzh's Linq
There are almost 90000 entities in the dwg.
Daniel your version looks like it would do better but it still must go through the same amount of steps