How to purge a block to mak me can use its block name again?

How to purge a block to mak me can use its block name again?

Anonymous
Not applicable
499 Views
4 Replies
Message 1 of 5

How to purge a block to mak me can use its block name again?

Anonymous
Not applicable

Like I say .There are some methods in cad2010 ,but some con't find in cad2008 . I try to use getobject().erase but when I try to make a block which have a same name with last one CAD show me a exception "duplicate name".I learn that when we erase a block,its name can't use again until the database be closed.....

0 Likes
500 Views
4 Replies
Replies (4)
Message 2 of 5

StephenPreston
Alumni
Alumni

When you erase a BlockTableRecord, it doesn't get removed until you save, close and reopen the drawing; so I can imagine AutoCAD not allowing you to create a new BlockTableRecord with the same name until that one is fully removed (otherwise someone might UNDO the changes, and then what name would the block take?

 

(Off the top of my head) Have you tried one of these approaches:

 

1. Rename the BlockTableRecord as well as erasing it.

2. Reuse the BlockTableRecord instead of erasing it (i.e. erase all its current contents and add your new ones.

 

Cheers,

 

Stephen Preston

Autodesk Developer Network

Cheers,

Stephen Preston
Autodesk Developer Network
0 Likes
Message 3 of 5

jeff
Collaborator
Collaborator

You could try or Stephen would know better if

Database.ReclaimMemoryFromErasedObjects Method

would work

You can also find your answers @ TheSwamp
0 Likes
Message 4 of 5

StephenPreston
Alumni
Alumni

Its worth a try. But read the extensive comments in the ObjectARX Reference Guide (i.e. for AcDbDatabase::reclaimMemoryFrom ErasedObjects) before you use it. There are some important caveats in there.

Cheers,

Stephen Preston
Autodesk Developer Network
0 Likes
Message 5 of 5

Anonymous
Not applicable

I am very appreciate of your RE.It's very usefull,and it does work.By the way my english is very poor,so sorry!

0 Likes