Find Sketch Relations with External References

I am trying to find a way to detect if a sketch relation has external references. I am able to loop through all sketches in a part, and loop through all relations in the sketch, but I'm not seeing a way to detect if the relation has an external reference or not. Does anyone know how I should approach this?

Thanks

SolidworksApi/macros