1

I'd like to enumerate all entities in an Autocad Drawing, but not using Autocad.Interop reference.

With Interop I could just pick:

IAcadApplication App = (IAcadApplication)Application.AcadApplication;
IAcadDocument Doc = App.ActiveDocument;

foreach (IAcadEntity Ent in Doc.ModelSpace) // or paperspace, or any IAcadBlock

But with the Object Arx references I can only find tutorials to get entities using transactions in a database, taking objects by ID. I think that's really boring stuff to slow down the works.

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214

1 Answers1

2

That's the way we do it. You have either the Interop code, or some fashion of objectid iteration.

Here's a good article from the Dev Network: http://adndevblog.typepad.com/autocad/2012/05/whats-the-best-way-to-iterate-through-an-entire-database.html

If you are going to work with C#, I recommend just biting the bullet, and moving on to use transactions and such, there is really no way around it.

dwolfe
  • 71
  • 2