[python-win32] Win32 exception occurred releasing IUnknown

Petr Dlabal petr at dlabal.cz
Fri Feb 26 15:16:25 CET 2010


Hi,
I'm trying to process large amount of autocad drawings by python
script using DWGDirect library (but I think I already saw the same
problem with original autocad automation with python). I'm trying to
explode the block in drawing and this action leads to delete the
original block from drawing. But the block object is still linked with
python object:
block = oDoc.ModelSpace.InsertBlock(....)
block.Explode() #this operation exploding the block to its elements
and removes the block from drawing
->Win32 exception occurred releasing IUnknown xxxx...

I think it is not possible to change the way how the Explode()
function work. Unfortunately, this exception frequently end by python
crash and I cannot catch the exception by try...except.
So, Is there any possibility to avoid this exception, or catch the exception?

Thank you

P.


More information about the python-win32 mailing list