From practical point of view, optimum design of structures under time variable loadings faces many challenges. Issues such as time-dependent behavior of constraints and the computational costs of the gradients could be mentioned. In order to prevent such difficulties, in this paper, response spectrum method has been utilized instead of applying direct time history method. Additionally, seismic design of structures is defined as a design for a specific response spectra not for an individual acceleration time history. Furthermore, here, in order to guarantee the global optimal designs, the obtained results from gradient-based method are compared with those from the discrete optimization technique (Genetic algorithm). As well, the P-Delta effects are considered in a seismic analysis. In addition, many practical constraints according to the Iranian national building code (NBC) are included in the optimization problem. The developed MATLAB based computer program is utilized to solve the numerical examples of low, intermediate and relatively high-rise braced and un-braced steel frames.