Yna_Db is correct, it’s read only and you need to use the SetProjection Method in a python node.
Here is an example of how to use the method:
element.SetProjection(AnalyticalElementSelector.EndOrTop, StickElementProjectionY.LocationLine, StickElementProjectionZ.Bottom)
Here is a complete working code:
import clr
# Import Revit API
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# Input
elements = UnwrapElement(IN[0])
if not isinstance(IN[0], list):
elements = [elements]
#Make changes to Revit DB in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for element in elements:
element.SetProjection(AnalyticalElementSelector.EndOrTop, StickElementProjectionY.LocationLine, StickElementProjectionZ.Bottom)
TransactionManager.Instance.TransactionTaskDone()
OUT = 0