It looks like annoying bug.
If you attach an userData by ACAPI_Attribute_SetUserData, and after it do ACAPI_Attribute_Modify, the UserData will cleared.
( it is tested on AC11 for layers, didnt try on later APIs )
GS, please, add this bug to the bug list.
Oleg.