Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 13011) +++ trunk/src/obj_subc.c (revision 13012) @@ -179,7 +179,23 @@ return 0; } +int pcb_subc_get_side(pcb_subc_t *sc, int *on_bottom) +{ + if ((pcb_subc_cache_update(sc) != 0) || (sc->aux_layer == NULL)) + return -1; + if (!sc->aux_layer->is_bound) + return -1; + if (sc->aux_layer->meta.bound.type & PCB_LYT_TOP) + *on_bottom = 0; + else if (sc->aux_layer->meta.bound.type & PCB_LYT_BOTTOM) + *on_bottom = 1; + else + return -1; + + return 0; +} + static void pcb_subc_cache_invalidate(pcb_subc_t *sc) { sc->aux_cache[0] = NULL; Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 13011) +++ trunk/src/obj_subc.h (revision 13012) @@ -80,6 +80,7 @@ /* calculate geometrical properties using the aux layer; return 0 on success */ int pcb_subc_get_origin(pcb_subc_t *sc, pcb_coord_t *x, pcb_coord_t *y); int pcb_subc_get_rotation(pcb_subc_t *sc, double *rot); +int pcb_subc_get_side(pcb_subc_t *sc, int *on_bottom); /* Search for the named subc; name is relative path in hierarchy. Returns NULL if not found */