Identifying Sketch relation status - Broken or Satisfied

Hello

I am working on a project which creates lines perpendicular to a surface. I am able to select different surface through code and lines are also generated through specific points, data of which is imported from excel. Now I need to make line perpendicular to any surface. As you can see from the image below. If a line can not be perpendicular to a surface due to geometric condition, it will show broken relation. So I need to know how can I identify whether the relation is broken or satisfied ? Also the lines in yellow in the image, should be perpendicular to top surface, similar to lines in black. But they are also giving error. If I do them Manually, They do not give error.

Thank you for your help.

SolidworksApi macros