# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitAPI","RevitServices")
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
vertical = IN[1]
horizontal = IN[2]
if not hasattr(elements,"__iter__"):
elements = [elements]
TransactionManager.Instance.EnsureInTransaction(doc)
for el,ver,hor in zip(elements,vertical,horizontal):
el.HorizontalAlignment = hor
el.VerticalAlignment = ver
TransactionManager.Instance.TransactionTaskDone()
OUT = elements
It worked on my side when I wrote it but now I can’t test it because I am running on Mac. I can tell you that tomorrow.
Which version of Dynamo do you use?
TransactionManager.Instance.EnsureInTransaction(doc)
for el,ver,hor in zip(elements,vertical,horizontal):
el.HorizontalAlignment = hor
el.VerticalAlignment = ver
TransactionManager.Instance.TransactionTaskDone()
OUT = elements
It will work. You should use those lists that you flattened.
# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitAPI","RevitServices")
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
vertical = UnwrapElement(IN[1])
horizontal = UnwrapElement(IN[2])
if not hasattr(elements,"__iter__"):
elements = [elements]
TransactionManager.Instance.EnsureInTransaction(doc)
for el,ver,hor in zip(elements,vertical,horizontal):
el.HorizontalAlignment = hor
el.VerticalAlignment = ver
TransactionManager.Instance.TransactionTaskDone()
OUT = elements
There is something wrong with those Nodes then. They give you String as output. They have to be member of Horizontal or VerticalAlignment Class.
I will take a look tomorrow.
# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitAPI","RevitServices")
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
vertical = IN[1]
horizontal = IN[2]
if not hasattr(elements,"__iter__"):
elements = [elements]
TransactionManager.Instance.EnsureInTransaction(doc)
for el,ver,hor in zip(elements,vertical,horizontal):
el.HorizontalAlignment = eval(hor)
el.VerticalAlignment = eval(ver)
TransactionManager.Instance.TransactionTaskDone()
OUT = elements