hexagon logo

Conditional behavior in solver script

I've got a model with contacts that is being run with several thousand cases in a Monte Carlo through the external solver. It runs statics and then dynamics. 99% of the cases run fine but a handful of them fail to obtain a static solution. The easiest way to resolve these failures is to change the contact faceting tolerance slightly (300 to 310 or something) and rerun. Is there a way to automate this behavior within an Adams solver script?
 
This is the behavior I want:
1) run sim/static
2) if failed, change faceting tolerance or some other setting and rerun sim/static
3) otherwise just continue to the dynamic solution