Cannot Purge missing ghost Blocks

HI All!

I Have this file we received from a client and I can’t get rid of these blocks:

Is there a safe way to get rid of them via python script without deleting also the Blocks instaces in the scene?

Thanks in advance!

I’m not sure what you mean - can you send the file to, to my attention, with a link back here in your comments?


File sent!
I’ll try to explain further:
In the file you will find only a few block instances.
If you open the block manager you will see that there are several blocks in addition to those present in the scene, and these blocks I can not delete them from the block manager with the classic purge.
I would like to delete all the blocks in the block manager list that are not present in the file.

Hi Andrea - in your file, delete the dwg file in BlockManager first, then the others can be deleted.


Hi Pascal, Good to know.

though, I would like to clean the file from unnecessary blocks via python because I have some errors in a script I am running automatically at startup.

Until now I used the purge command throught rs.command, but in this case it doesn’t work.

Hi Andrea - I guess one way would be to do this in stages in your script - make a pass (however you are doing that in the script0 , if any blocks are removed make another pass, etc. until none are removed… something like that.