Well, I went in and redid it so I could take a few screenshots to show how I did it, since the original file I did it on no longer exists. It's an idea I came up with while playing an Eco-Friendly family on a smaller lot. I wanted to place solar panels, but I didn't want to waste their already limited yard space with them, since I had also wanted to place windmills. That's when I remembered a childhood friend's house that had the panels on the roof. After a bit of messing around with it, here's how I did it.
Once your house is built, first thing you need to do is apply a floor to the "attic" area, so everything has something to sit on.
Once that is done, remove the roof completely (or at least the section that you want to place the solar panels on), and place a single width row of frieze. If you're looking to save a bit of cash, you can place 1x1 sections of frieze with two squares of gap in between, and fill the gaps with the free floor tiles.
Once your elevation is in place, put the roof back on and lower it as far as you can. This will make it easier to place the solar panels on the second level.
With the "moveobjects" cheat on, place your solar panels like so. Notice that the top row of solar panels is barely sitting on the frieze. You want to do it like this so that the frieze isn't visible through the roof once it's done.
And once the solar panels are in place, you simply raise the roof elevation so that it looks like the panels are attached to it.
You could run into a situation where your roof is bigger due to the size of the house, and you may want to center the solar panel array closer to the middle of the roof. This is easily done by placing a frieze on top of a frieze:
You don't need the extra row of frieze in the back. I was just trying to do it quickly. And as shown here, it's just as easy to replace the roof after the solar panels are placed (this is something I figured out while doing this, and didn't know it was possible originally. I assumed that the panels would interfere with it, but it doesn't).
But when it's all said and done, this is what you end up with.