That would work just fine. I'm hesitant to link the power grids of the factory buildings because a) that would make power transfer completely unrealistic, with factory buildings requiring no physical electric connection to power each other, b) create feedback loops when some factory buildings are set to input and others to output, and c) make power switches useless.