Based on the D-H notation, kinematics model and inverse kinematics model of 6R industrial robots are established. Using graphical method, the boundary curve equations of the 6R industrial robot workspace are obtained. Based on the prescribed workspace, the D-H parameter optimization method of 6R industrial robots is proposed. Using the genetic algorithm to determine the structural dimensions of a 6R robot, we make sure that its workspace can exactly contain the prescribed workspace. This method can be used to reduce the overall size of the robot, save materials and reduce the power consumption of the robot during its work time.