check for errors

Is there a way to check if a sketch is in an unsolvable state after adding a constraint? I have a for loop where I create a line and then constrain it to another line. If the constraint makes the sketch unsolvable, then I need to call a function to perform some operations.

SolidworksApi macros