LINQ and the AutoCAD .NET API (Part 1)

This is the first in a series of posts on LINQ an the AutoCAD .NET API. Here’s a complete list of posts in this series.

I recently played around with the AutoCAD .NET API and I want to share some ideas I had on how to make use of IEnumerable<T> when dealing with the drawing database. Generally speaking, the AutoCAD API is very powerful as the drawing is based on a database and you use transactions to interact with the drawing data. If something goes wrong, you simply abort the transaction and your changes are rolled back. Nice. But this comes with the cost of writing a lot of boilerplate code. Continue reading