Hello,
what have you tried?
The script you mention was just a test for one single element.
To work with multiple parts you must learn how to use loops in python, for example:
You will probably need something like:
parts=UnwrapElement(IN[0])
faces=UnwrapElement(IN[1])
TransactionManager.Instance.EnsureInTransaction(doc)
for part,face in zip(parts,faces):
part.SetFaceOffset(face,offset)
TransactionManager.Instance.TransactionTaskDone()
I know very little about Python.
I have tried putting in the script you provided, but I get the error as shown in the image.
I will study the website you provided.
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
test=
parts=UnwrapElement(IN[0])
faces=UnwrapElement(IN[1])
offset=IN[2]/304.8 #decimal to imperial
TransactionManager.Instance.EnsureInTransaction(doc)
for part,face in zip(parts,faces):
part.SetFaceOffset(face,offset)
TransactionManager.Instance.TransactionTaskDone()
I have not tried it, but how about changing it as follows?
offset=IN[2]
TransactionManager.Instance.EnsureInTransaction(doc)
for part,face,off in zip(parts,faces,offset):
part.SetFaceOffset(face,off/304.8)
TransactionManager.Instance.TransactionTaskDone()
Thanks for the reply.
It didn’t work with the error “unexpected token ‘Element’” returned.
However, I solved the problem by creating a custom node including the original Python Script.
Still, thanks for your help.