Hi,
The problem it's not a trivial one (well, in some sense it is, just test for all the combinations and pick the best). The problem even has a name: 1DCSP (1 Dimensional Cutting Stock Problem). In general You can't test for all the combinations even with a supercomputer in a reasonable time, so you need to find an "optimal" solution with a more efficient approach, there are several methods almost all based in OR technics, but there are some others like genetic algorithms, ant colony optimization and so on.
If you are *really* interested in a solution, you can privately contact me at "gaston dot nunez at asyst dot cl", i have an AutoCAD solution for exactly the same problem you have.
Gaston Nunez