Since the introduction of spatial grammars 45 years ago, numerous grammars have been developed in a variety of fields from architecture to engineering design. Their benefits for solution space exploration when computationally implemented and combined with optimization have been demonstrated. However, there has been limited adoption of spatial grammars in engineering applications for various reasons. One main reason is the missing, automated, generalized link between the designs generated by the spatial grammar and their evaluation through finite-element analysis (FEA). However, the combination of spatial grammars with optimization and simulation has the advantage over continuous structural topology optimization in that explicit constraints, for example, modeling style and fabrication processes, can be included in the spatial grammar. This paper discusses the challenges in providing a generalized approach by demonstrating the implementation of a framework that combines a three-dimensional spatial grammar interpreter with automated FEA and stochastic optimization using simulated annealing (SA). Guidelines are provided for users to design spatial grammars in conjunction with FEA and integrate automatic application of boundary conditions. A simulated annealing method for use with spatial grammars is also presented including a new method to select rules through a neighborhood definition. To demonstrate the benefits of the framework, it is applied to the automated design and optimization of spokes for inline skate wheels. This example highlights the advantage of spatial grammars for modeling style and additive manufacturing (AM) constraints within the generative system combined with FEA and optimization to carry out topology and shape optimization. The results verify that the framework can generate structurally optimized designs within the style and AM constraints defined in the spatial grammar, and produce a set of topologically diverse, yet valid design solutions.