Set analytical column Z Projection parameter

@James_Washbourne

Here are the relevant sections from revitapidocs:

If you want to add the Enumerations as string inputs you can use the Enum.Parse method.

image

import clr
import System
# 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])
topZPriojection = System.Enum.Parse(clr.GetClrType(StickElementProjectionZ),IN[1])
bottomZProjection = System.Enum.Parse(clr.GetClrType(StickElementProjectionZ),IN[2])
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, topZPriojection)
	element.SetProjection(AnalyticalElementSelector.StartOrBase, StickElementProjectionY.LocationLine, bottomZProjection)
TransactionManager.Instance.TransactionTaskDone()

OUT = 0
2 Likes