.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Freeing objects after erase.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
tech
518 Views, 2 Replies

Freeing objects after erase.

I want to purge objects after erasing them to free up allocated memory. 

 productMgd.Erase();
 var erased = new ObjectIdCollection();
 erased.Add(productMgd.Id);
 database.ReclaimMemoryFromErasedObjects(erased);

This is happening within a single transaction. When the call to ReclaimMemoryFromErasedObjects(...) is reached, I get the error eInvalidOpenState. Any examples of using this method? Can anyone shed some light on why this error is being returned. The object is stored in a dictionary, not modelspace.

 

Mike

2 REPLIES 2
Message 2 of 3
FRFR1426
in reply to: tech

The doc says:

> All object ids in the collection must correspond to erased objects, which must be entirely closed. 

So I think you should commit your transaction before calling this method.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Message 3 of 3
deepak.a.s.nadig
in reply to: tech

Here is a blog post which shows an example of reclaiming memory of erased objects:

http://adndevblog.typepad.com/autocad/2012/04/reclaiming-memory-of-erased-objects.html

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report