[SOLVED] Is there any way to attach -D from within arduino IDE

Great. I don't see why you can't do that. The extra flags are just passed to the compile statement without change, so should work fine.