Object disappears when zooming out
I do not know python, however you can change the depth of field to make it bigger or smaller to make you able to see the object in it's entirety.

Go to the Properties Panel (N) -> View -> Clip and change the End distance to increase the field of view and allow the whole object to be seen when zooming out.

Be mindful that it may slow down your computer is the object in question is very big and complex.