Index: trunk/src/netlist_act.c =================================================================== --- trunk/src/netlist_act.c (revision 38257) +++ trunk/src/netlist_act.c (revision 38258) @@ -719,8 +719,10 @@ } break; case F_Remove: + if (!rats_patch_is_subc_referenced(pcb, subc->refdes)) + return 0; /* already removed */ rats_patch_break_subc_conns(pcb, subc, undoable); - return rats_patch_del_subc(pcb, subc, undoable); + return rats_patch_del_subc(pcb, subc, 1, undoable); default: rnd_message(RND_MSG_ERROR, "BaSubc(): invalid second argument\n"); } Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 38257) +++ trunk/src/rats_patch.c (revision 38258) @@ -509,13 +509,15 @@ return 0; } -int rats_patch_del_subc(pcb_board_t *pcb, pcb_subc_t *subc, int undoable) +int rats_patch_del_subc(pcb_board_t *pcb, pcb_subc_t *subc, int force, int undoable) { if ((subc->refdes == NULL) || (*subc->refdes == '\0')) return -1; - if (!rats_patch_is_subc_referenced(pcb, subc->refdes)) - return 0; /* already removed */ + if (!force) { + if (!rats_patch_is_subc_referenced(pcb, subc->refdes)) + return 0; /* already removed */ + } pcb_ratspatch_append(pcb, RATP_COMP_DEL, subc->refdes, NULL, NULL, undoable); Index: trunk/src/rats_patch.h =================================================================== --- trunk/src/rats_patch.h (revision 38257) +++ trunk/src/rats_patch.h (revision 38258) @@ -91,7 +91,7 @@ /* Remove a subc from the netlist patch of pcb if subc is referenced from the netlist. Returns 0 on sucess.*/ -int rats_patch_del_subc(pcb_board_t *pcb, pcb_subc_t *subc, int undoable); +int rats_patch_del_subc(pcb_board_t *pcb, pcb_subc_t *subc, int force, int undoable); /* Back annotate removal of all connections of a subc */ void rats_patch_break_subc_conns(pcb_board_t *pcb, pcb_subc_t *subc, int undoable);