I know that Workspace.B.CFrame = workspace.A.CFrame * CFrame.new((workspace.Part.Size.X/2+workspace.B.Size.X/2), 0, 0) will offset the part so that part B is right beside part A.
What I want to do is rotate the part around that point. So basically, act as though there is a joint in between the two parts and rotate around it. It would also be useful to know how to change the offset of said 'joint' so that the pivot point is set to the top edge of part.
I did try Workspace.B.CFrame = workspace.Part.CFrame * CFrame.new((workspace.Part.Size.X/2+workspace.B.Size.X/2), 0, 0) * CFrame.Angles(0, 0, math.rad(45)).
This didn't work the way I though it would. The rotation is obviously going to vary and will probably be on all axes.
Math isn't my strong suite so thanks a lot for the help.

2 comments
While this is a good suggestion it won't work for me. I know it is possible to set a pivot point using math. Thanks anyway though.
Np.