An algorithm for drawing large, complex pedigrees containing inbred loops and multiple-mate families is presented. The algorithm is based on a step-by-step approach to imaging, when the researcher determines the direction of further extension of the scheme. The algorithm is implemented as the PedigreeQuery software package written in Java. The software has a convenient graphical interface. The software package permits constructing not only whole pedigrees, but also their fragments that are particularly interesting for research. It also allows for adding new information on the phenotypes and genotypes of pedigree members. PedigreeQuery is distributed free of charge; it is available at http://mga.bionet.msc.ru/PedigreeQuery/PedigreeQuery.html and ftp://mga.bionet.msc.ru/PedigreeQuery/.