I'm working on an ulp script that will increase pad diameter of devices by specified ratio like 0.25 so pads will be a little bit bigger and will be less likely destroyed while etching/soldering the PCB. The original script I took as an example is drill-aid.ulp and now everything is working fine except one thing: this extra circles are placed in single layer regardless top/bottom layer (this the original behaviour of drill-aid) and this is wrong in my opinion. So, what I want to do is to check if something is connected to the pad in that layer (bottom or top) and if so, place circle in one of two additional layers so the can be switched off in Layer window before printing. I know it somehow connected with pad flags, but as I'm a newbie to ulp stuff can brake through this.
Can anybody help and make an example of if() to check this?