Based on a minimum time algorithm the planning of in and out of dense storage with complicated storage objects and numerous storage positions was studied. By studying Iron automated pharmacy system, the full planning of in and out of dense storage was given, including initial storage position planning, and the order planning of drug in and out of storage with the minimum time constraint. The model was built, and it was proved that this planning satisfied the requirements of the practical engineering. Especially, the planning has been considered suitable for the study of pharmacy automation storage.Index Terms -automatic pharmacy system; planning of in and out of dense storage; minimum time algorithm; dense storage.