Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 14181) +++ trunk/src/obj_subc.c (revision 14182) @@ -179,6 +179,25 @@ return 0; } +pcb_bool pcb_subc_find_aux_point(pcb_subc_t *sc, const char *role, pcb_coord_t *x, pcb_coord_t *y) +{ + pcb_line_t *l; + + if (sc->aux_layer == NULL) + pcb_subc_cache_update(sc); + if (sc->aux_layer == NULL) + return pcb_false; + + l = find_aux_line(sc->aux_layer, role); + if (l == NULL) + return pcb_false; + + *x = l->Point1.X; + *y = l->Point1.Y; + + return pcb_true; +} + int pcb_subc_get_origin(pcb_subc_t *sc, pcb_coord_t *x, pcb_coord_t *y) { if ((pcb_subc_cache_update(sc) != 0) || (sc->aux_cache[PCB_SUBCH_ORIGIN] == NULL)) Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 14181) +++ trunk/src/obj_subc.h (revision 14182) @@ -122,6 +122,11 @@ /* Create a new point on the aux layer using a given role string in attribute */ void pcb_subc_create_aux_point(pcb_subc_t *sc, pcb_coord_t x, pcb_coord_t y, const char *role); +/* Look up an aux point and return pcb_true if found; when found, load x and y + with the coords of the point. */ +pcb_bool pcb_subc_find_aux_point(pcb_subc_t *sc, const char *role, pcb_coord_t *x, pcb_coord_t *y); + + /*** loops ***/ #define PCB_SUBC_LOOP(top) do { \