Message 1 of 3
best way to process data when iterate each object in modelspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi,
I just built a app. now I like to make some re-factory. I found I iterate all objects of whole modelspace in 5 places. it will take lot of time for big drawing. I like to change to scan modelspace once.
also make the 5 tasks configurable. depend on the config file, I can run 1 task, or 5 tasks.
how should I design the code?
Here is code I use, which should from Scott McFarlane and Tony T.
public static void ForEach<T>(this Database database, Action<T> action)
where T : Entity
{
database.UsingModelSpace((tr, modelSpace) => modelSpace.ForEach(tr, action));
}
Windows 10 64 bit, AutoCAD (ACA, Map) 2023