Skip to content

Instantly share code, notes, and snippets.

@wtertinek
Created August 2, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtertinek/110d2d2b1feb490974f7175e4411e19b to your computer and use it in GitHub Desktop.
Save wtertinek/110d2d2b1feb490974f7175e4411e19b to your computer and use it in GitHub Desktop.
Count all entities in all layouts
using (var db = AcadDatabase.Active())
{
var allEntities = db.PaperSpace()
.SelectMany(ps => ps)
.Concat(db.ModelSpace);
System.Diagnostics.Debug.WriteLine("There are " + allEntities.Count() + " entities in all layouts");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment