Yes you can. Take a look at Construction:ComplexFenestrationState in Input/Output reference. I would highly recommend to use LBNLs WINDOW software to generate IDF for the window.