Volumetric error (VE) is determined by machine tool geometric error elements (GEE). Most of VE models in recent studies have a common issue that some GEE are missing in models explicit mathematical expressions, which directly affects machine tool VE prediction accuracy. Therefore, a methodology for complete modeling machine tool VE was proposed. Multi-body system theorem and homogeneous coordinate transformations were borrowed as analysis approaches. On the basis that initial positions and original errors eigen matrix were fully considered, VE model was guaranteed to have total machine tool GEE. Furthermore, aiming at the residual error limitation in traditional NC code VE compensation technique, NC code coordinates optimization design problem was described to replace the former reversal accumulation process. Genetic algorithm (GA) was then utilized to solve the proposed optimization problem so that VE compensation residual error was eliminated. A horizontal machining center was selected as study object, on which both numerical and experimental analyses were performed to verify the proposed modeling methodology and compensation technique. The results indicated that complete VE model comprises total 21 GEE of machining center and that VE prediction was fairly accurate. It was also showed that NC code optimized compensation technique presented in this paper may promote machining center volumetric position precision (VPP). The maximum growth of VPP, compared to uncompensated value, was 90.92%. Research results can be regarded as theorem and engineering supports for investigations on numerical manufacturing equipment precision problems.