This paper presents a new method to optimally design active compliant mechanisms. It is partly based on a flexible building blocks method called FlexIn, which had been developed at the French Atomic Energy Commission (CEA). This method uses an evolutionary algorithm approach to optimize a truss-like structure, made of an assembly of passive and active piezoelectric building blocks from two specific libraries. The mechanical approach used to establish the actuator model of the piezoelectric block and its validation by a commercial finite element software are described. Then, the optimization method is illustrated by the synthesis of a planar monolithic compliant microgripper device. Finally, the mechanical performances of a pseudo-optimal mechanism are commented, and demonstrate the interests of the proposed optimization method for the design of smart structures.