A modified version of the solenoid structural analysis computer program STANSOL II has been linked to a constrained optimization algorithm to obtain more cost-effective magnet designs. The linking of these two programs permits the designer and analyst to investigate optimization of various parameters used to define solenoid coils. Geometric and other variables can then be adjusted so that loads, stresses, strains, and displacements can be minimized or constrained. This paper details this work and solves an example problem regarding variable winding schemes to minimize bobbin crush pressures for a typical coil configuration.