Mail Archives: geda-user/2015/05/13/17:50:00
On 05/13/2015 10:34 AM, DJ Delorie wrote:
> The way it works is I type "go 587-1299-1" or something on the command
> line (which also tells me how many to place), then hit 'g' in the PCB
> window (which highlights them).
>
> My pcb-menu.res has this somewhere:
>
> {"grep" a={"G" "<Key>g"} ExecuteFile(/tmp/pcb.grep)}
>
> And I use this script in the working directory (my "go" runs it, call
> it what you want):
>
> #!/usr/bin/perl
> # -*- perl -*-
>
> $reg = shift;
> open(B, "board.bom");
>
> $first = 1;
>
> open(G, ">/tmp/pcb.grep");
> print G "Unselect(All)\n";
>
> while (<B>) {
> chomp;
> ($refdes, $value, $footprint, $device, $voltage, $manufacturer, $manufacturer_part_number, $vendor, $vendor_part_number, $qty) = split(':', $_);
>
> if ($first || /$reg/i) {
> print "\033[34m" if $first;
> printf("%-7s %-24s %-18s %s\n", $value, $manufacturer_part_number, $vendor_part_number, $refdes);
> print "\033[0m" if $first;
> if (!$first) {
> for $r (split(',', $refdes)) {
> print G "Select(ElementByName,$r)\n";
> $count ++;
> }
> }
> $first = 0;
> }
> }
>
> print "\n\033[32m$count parts\033[0m\n";
>
> close G;
thank You!
yvette
- Raw text -