It is number between 1 and GetNumSmithingPatterns(), see:
http://esodata.uesp.net/current/src/...d.lua.html#662
And if I'm not mistaken this function works only when you're interacting with crafting station (and results are for each crafitng station different).