speed up search of list

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have drawings with 1-200 circuit plines each with 1-500 vertexes.
There are also device blocks at the pline vertexes (10-10000).
I have several commands that look at specific plines and then find the devices on that pline.
My code finds all plines and creates a list of vertexes, then finds all device blocks and creates a list of the insertion point and entity name.
To find all blocks on a pline, I have been checking each vertex against the device coordinate list.
I have tried while, foreach and they are too slow when I start having more than 500 devices.
I am looking for a faster method of searching the lists.
Note -
blocks might be at several vertexes of multiple plines (so I can stop once I find a block)
the blocks might be just off the vertex by miniscule amount, so I have to use (equal P1 P2 0.00000000001) or (< (distance P1 P2) 0.00000000001)
Any help would be great!