If you want to leave them green and pristine, i would recommend attaching them after painting. If you have a very steady hand, you can work around them, but it's just easier not to have to.
If you want to do the some of the different effects shown in the codex, before painting, obviously.