The path planning of a measuring robot is critical to automatic measurement, but it is hard to solve a global optimal path solution when it comes to scanning a complex body with many obstacles. To overcome this problem, a direction guidance Rapidly-exploring Random Tree algorithm (DG_RRT) is proposed. First, to improve the efficiency of the search process, the strategy of direction guidance is introduced for the initial path based on the traditional RRT algorithm. Second, invalid paths are simplified by linear processing. Third, to balance the length of the path and the planning time, generated paths are further corrected by adjusting the step size, optimizing threshold parameters, and smoothing the curve. To verify the suggested method, both numerical simulation and experimental analysis are carried out. The experimental results show that the average length of the paths (ALPs) of DG_RRT is 29.6% lower than that of the traditional RRT, 6.6% lower than that of RRT* and 43.0% lower than that of Q-learning (QL). The standard deviation (SD) of the path length of DG_RRT is 93.4% lower than that of traditional RRT, and 83.1% lower than that of RRT. The mean of planning time (MPT) of DG_RRT is 94.3% lower than that of RRT*, 95.5% lower than that of QL. The number of discrete points on the path of DG_RRT is 81.4% lower than that of traditional RRT, 86.0% lower than that of RRT* and 91.7% lower than that of QL. It demonstrates that the DG_RRT is superior to other traditional methods.