diff --git a/.scripts/foot_gen.py b/.scripts/foot_gen.py index 4aaf4e8..8fc2992 100644 --- a/.scripts/foot_gen.py +++ b/.scripts/foot_gen.py @@ -53,14 +53,17 @@ for item in pcb.GetDrawings(): foot = foot_sp[0].strip() offset = (0,0) # Optional offset tuple - if len(foot_sp) == 2: + if len(foot_sp) > 1: print("Foot sp: ", foot_sp) offset = foot_sp[1].strip(" ()").split(',') print("Offset: ", offset) offset[0] = FromMM(float(offset[0])) offset[1] = FromMM(float(offset[1])) + disable_model = False + if len(foot_sp) > 2: + disable_model = eval(foot_sp[2]) - new_foots[ref] = [foot, offset] + new_foots[ref] = [foot, offset, disable_model] # pins = sp[1] # pin_refs = [] # for pin in pins.split(','): @@ -126,6 +129,9 @@ for foot in saved: cent_diff = orig_cent - new_cent load_foot.SetX(load_foot.GetX() + cent_diff.x + vals[1][0]) load_foot.SetY(load_foot.GetY() + cent_diff.y + vals[1][1]) + # Disable model if applicable + if vals[2]: + load_foot.Models().clear() # Flip the net assignments of the pads pad_map = {} for pad in load_foot.Pads():