An algorithm as well as a program for calculating mechanical loads in spacecraft structure are developed in the frame of its preliminary strength assessment. The algorithm was developed with the aim of calculating loads of several design cases simultaneously. The main object for study of this paper was an algorithm for calculating internal forces for a bending beam. As part of a preliminary assessment, such an algorithm can be used to calculate the responses, which are appeared in the spacecraft structure during its ground and flight operations. In order to provide an effective use of developed algorithm, a computer program has been written. This program provides an automated calculation of loads in the spacecraft structure with the ability to output data in a format which convenient for its further use. Such parameters as geometrical data, mass properties of the spacecraft, its test and launch conditions, qualification factors and safety coefficients are initial data to start the calculation. To verify the results obtained with the program, they were compared with the results of the analytical solution of a similar problem. From the check it was revealed, that they are coincide.