Code to turn blocks quickly when imported

Hi,

when I import a blocks (e.g. valve). I need to do a couple of clicks to turn it in the right directions.

However, it would be great that after import you can hit a key to turn the block in a certain direction. After a couple of clicks of this key you will have your block in the correct position.

Is there anybody how knows if this is possible with a piece of short code?