Yes, this old chestnut…I thought I had posted this ages ago, but I don’t see in the archives, so:
If you want to check if an object exists, and you don’t want to deal with any error handling, then do it this way:
from sipyutils import disp # win32com.client.Dispatch
def objExists( name ):
c = disp( "XSI.Collection" )
c.Items = name
return not( c.Count == 0 )
print 'Object does exist' if objExists( "XSI_Man.geom" ) else 'Does not exist'