For the convenience of complex trajectory programming of robot and in order to enrich robotic off-line programming (OLP) types, this paper presents an efficient robotic OLP method based on DXF files of 3D modeling software. By decoding DXF files, the 3D position information of object graphic elements such as points, lines, arcs and splines are first extracted, all the graphic elements are then converted into point elements. A trajectory planning algorithm is proposed to make these points linked into robot trajectories according to the drawing order in CAD software. Except for the position information of the trajectory, the orientation of the trajectory is also planned by an easy and efficient method. Coordinate transformation is fulfilled by calibration,The planned trajectory is verified with OpenGL simulation, the executable program is then generated and downloaded into the robot controlle. Experiment results of the 5-DoFs modular robot show that the presented OLP system is effective and can be used in practice.