Pivot axis rotation

Hi, guys! I need help. I need simple script which, when I press button, will rotate selected model pivot axis- Y looking upstairs and then export this model. Maybee someone can help me!