Ansys Employee

I wonder if the cell isn't passed to the macro,  Example suggests you may need to tell the UDF about the cell, and thread: look for  cell = PP_CELL(p)   That may not fix the problem, but may get you a bit further.

Once you get it working please post the structure for others.