Hi, ckadam.
I work with quite similar issue now. First question for you - are you sure that your objects are Ug_component(it's not clear from code you provided) If it's so - it's the reason of error, because ug_askminimumdistance works with points, curves, datum_planes, edges, faces, solids...