This paper describes a generative design approach integrating real building data in the process of developing a shape grammar. The goal is to assess to which extent it is feasible the use of a reverse engineering procedure to acquire actual building data and what kind of impact it may have on the development of a shape grammar.The paper describes the use of Terrestrial Laser Scanning (TLS) techniques to acquire information on the São Vicente de Fora church, then the use of such information to develop the corresponding shape grammar, and finally the comparison of this grammar with the grammar of Alberti’s treatise, to determine the grammatical transformations that occurred between the two grammars.