I've actually written a complete customization to consolidate packages and create other packages based on the individual size of items and a table with the available boxes used to package items. I've written a routine based on a Bin Packing algorithm that uses the volume of each item, whether the item is stackable, and the stacking height delta for each additional item. When one box is full, I look at the remaining volume and find an appropriately sized box to fit the remaining items. All items are sorted by decreasing size prior to packing so I'm putting the largest items inside the box first, then finding the next item to fit, etc. until all items are packed.
I also have a routine for creating tape bundles because we have smaller boxes that contain a single item, but they could be stacked and taped together so they would get 1 UPS label without exceeding the 84" limit of girth + length. It works well for our application.
Parrothead
"I'd rather die while I'm livin' than live while I'm dead."