Last active
January 7, 2020 15:09
-
-
Save johnpierson/933437a3de4ad883b431e829a45d0719 to your computer and use it in GitHub Desktop.
Host railing to topo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr | |
clr.AddReference('RevitAPI') | |
from Autodesk.Revit.DB import * | |
clr.AddReference('RevitServices') | |
import RevitServices | |
from RevitServices.Persistence import DocumentManager | |
from RevitServices.Transactions import TransactionManager | |
doc = DocumentManager.Instance.CurrentDBDocument | |
railings = UnwrapElement(IN[0]) | |
newHost = UnwrapElement(IN[1]) | |
TransactionManager.Instance.EnsureInTransaction(doc) | |
# in a for loop, i represents an instance of the object in a list. | |
# so it can be looked at as "for each railing (i) in railings" | |
for i in railings: | |
i.HostId = newHost.Id # we get the id in here for simplicity | |
TransactionManager.Instance.TransactionTaskDone() | |
OUT = railings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment