In theory fences and such should automatically connect up as "placed", but don't know if that works at the moment through generation. If I or someone else ever get around to improving this to happen during chunk tessellation where possible then it certainly would be the case.
Otherwise... yes, through BlockFamily, or else through knowing the exact uri of the block (would end with .left and so forth, kind of messy to work that way though).
The getBlockForPlacement() method allows you to get a rotation of a block, given some hints and the current state of the world. The current state bit may be problematic during world generation though. Might need to have a second version of this. Other than that the two pieces of information used are:
* Side attachmentSide - The side of a block the new block is being attached to. Typically the ground, I would imagine. For a torch it would be the side of a wall. This corresponds to the surface the player is targeting.
* Side direction - A secondary direction hint for where the block should face. This corresponds to the primary direction the player is facing.
How these hints are used depends on the block family, but for slopes and stairs attachment side determines rotation if it is a wall, and the facing direction is used otherwise.