This program will annotate (number) the components on a gschem schematic. It will optionally renumber the same components on a board layed out with xpcb. It is needed because the bugs and limitations in the gschem's built in auto-numbering routine makes it of little or no use. Feature comparison: Package: xpcb builtin annotate_gschem ---------------- --------------- Each component type has no yes its own numbering sequence Can renumber board no yes and schematic together Can renumber only one type yes yes of part or all parts Can number based on no yes schematic coordinates Can number based on no yes pcb coordinates Can preserve existing no yes numbers Can renumber existing numbers yes yes Can choose whether or not to fill gaps in existing numbering no yes Can renumber left to right no yes right to left no yes top to bottom no yes bottom to top no yes file order yes no Can use leading zeros on part numbers no yes The program will ignore any components on the PCB not found on the schematic. This means their numbers could be reused resulting in duplicate numbers on PCB layout. A related utility, which I wrote, is called gschem2xpcb. It will automatically layout the schematics. xpcb: http://pcb.sourceforge.net/ gschem: http://www.geda.seul.org/ gschem2xpcb: http://www.freelabs.com/~whitis/software/gschem2xpcb/ Compilation ----------- make Installation ------------ make install Running ------- For help: annotate_gschem --help Renumber all parts, order sheet/x/y annotate_gschem --input_file=infile.sch --output_file=outfile.sch Renumber all parts, order sheet/x/-y annotate_gschem --input_file=infile.sch --output_file=outfile.sch --reverse_y_order Renumber all parts, order sheet/-x/y annotate_gschem --input_file=infile.sch --output_file=outfile.sch --reverse_x_order Renumber all parts, order sheet/y/x annotate_gschem --input_file=infile.sch --output_file=outfile.sch --x_major=0 To not renumber already numbered components: annotate_gschem --input_file=infile.sch --output_file=outfile.sch --renumber=0 To not reuse gaps in existing numbers (i.e. C1, C2, C5, C6) such as you might get if you deleted parts: annotate_gschem --input_file=infile.sch --output_file=outfile.sch --fill_gaps=0 To number parts staring from 0 (or some other number): annotate_gschem --input_file=infile.sch --output_file=outfile.sch ==starting_number=0 To use leading zeros in part numbers (R01, R02, R02, ...): annotate_gschem --input_file=infile.sch --output_file=outfile.sch --leading_zeros --number_of_digits=2 To only renumber resistors: annotate_gschem --input_file=infile.sch --output_file=outfile.sch --filter_prefix="R" To renumber a board file and schematic at the same time, based on board positin rather than schematic position with leading zeros on refdes: annotate_gschem --input_file=micro.sch.bak --output_file=micro.sch --input_pcb_file=micro.pcb.bak --output_pcb_file=micro.pcb --renumber --sort_board_xy --leading_zeros Sheets ------ Gschem can't store multiple schematic sheets in the same file and the handling of sheets was definitely not well thought out. Two ways of handling sheets are a hierarchy of sheets where sub-sheets are treated like symbols and to just have a bunch of unlinked files. While this program has a field for sheet number, it is not implemented. You can renumber parts using a different starting number for each file. annotate_gschem --input_file=infile-1.sch --output_file=outfile-1.sch ==starting_number=100 annotate_gschem --input_file=infile-2.sch --output_file=outfile-2.sch ==starting_number=100 annotate_gschem --input_file=infile-3.sch --output_file=outfile-3.sch ==starting_number=100 You could also renumber one type of component at a time using --filter_prefix and start with the highest_number+1 used on the preceeding sheet, but that would be a nuisance. You could temporarily concatenate each sheet file into one large file and then split them after annotation. The program isn't very picky about format so you could add a comment between files. Caveats ------- This program was quickly written so I could annotate my schematic and get back to working on my design. It has not been thoroughly tested and may have bugs if presented with strange input. Backup your schematic/board files before running. It has, however, been tested on a schematic with over 200 components and used to number new components while preserving existing ones. And it has been used to renumber a board and schmatic together with 86 components. LICENSE ------- http://www.freelabs.com/~whitis/software/license.html