Which version of Revit do you use ? Here is an explanation of what the API allows with the different versions of Revit :