To meet the need for product variety, many companies are shifting from a mass-production mode to mass customization, which demands quick response to the needs of individual customers with high quality and low costs. The multifunctional nature of mechanical components necessitates that a designer redesign them each time when a component’s function changes. The functional Geometric Dimensioning & Tolerancing (GD & T) specification, also called functional tolerancing, must be updated for each component. Currently, this is done by humans, and thus can be very time-consuming and error-prone. Functional tolerancing is one of the main obstacles to practical mechanical product family modeling. In this paper, a graph-based functional tolerancing scheme in 3D CAD is proposed. In the scheme, a product is generated by applying production rules to the graph of the base product, following customers’ or manufacturing engineers’ requirements. Functional tolerancing of each component of a product in the family is formulated as a non-linear constrained optimization (or cost minimization) process. Certain critical aspects of the scheme have been implemented in SolidWorks®, by using its Application Programming Interface (API) and C++. LEDA® and MATLAB® have been used to solve the graph and optimization problems.