Hexagonal nut tutorial
Open mechanical workbench
Invoke a sketch on xy plane .
Draw a hexagon as shown and keep the topmost part horizontal
Draw a circle in the same sketch and give the dimensions.
Exit the sketch and pad it with "mirrored" extent.
Select zx plane and invoke sketch.
Draw a sketch as shown in the figure
Mirror the sketch about the horizontal axis and exit the sketch
Groove the sketch with the vertical axis as the axis of rotation.
Here you have your hexagonal nut.