According to the geometric sharp features of CAD assembly models, an algorithm for the automated generation of grid-based full hexahedral element meshes was developed. This method involves six steps: geometric feature identification, cubic grid structure generation, jagged core mesh generation, surface matching, topological optimization and node smoothing. In the grid-based hexahedral mesh, the quality of the inner mesh is fine, the quality and the topological connections are very bad. Considering the specialty of the grid-based, this paper focused on the research for the surface matching and the topological optimization techniques in the grid-based hexahedral mesh generation. Among the surface matching process in this paper, a new matching algorithm combining the embedding technique was proposed, establishing the corresponding the boundary element relation between solid models and core grid, to make the hexahedral mesh accurately describe the geometric features of multiple-component assemblies. Among the topological optimization process, a new optimization technique was proposed, building the hexahedral shrink sets for the every geometry body and geometry surface, and then eliminating the hexahedral elements with bad topological connection by adding a layer of hexahedral elements on the boundary of the corresponding shrink set. Numerical examples show that the hexahedral mesh generated by the algorithm proposed in this paper described accurately the geometric features of the numerical models, and eliminated the poor hexahedral elements.