jbrugion opened this issue on Feb 08, 2001 ยท 7 posts
jbrugion posted Thu, 08 February 2001 at 1:48 PM
Found out last night that the actor.Geometry() call might throw an error if you try to use it on an actor that has no geometry associated with it. Was trying to loop over the actors in a figure and got an error message in the python window when it tried to get the geometry from the body. Need to wrap that call inside a try-except statement as so: try: tab geometry=actor.Geometry() except: tab # something to do if no geometry present You can see an example of this in the randomize and bulge figure scripts under the Geometry Mods button. For those of you not familiar with exception handlers you put the code that you want to execute, but which might throw an error, in the "try" block and in the "except" block put some code to handle the error condition. If the code inside the "try" block throws an error execution jumps to the "except" block.