Created
March 17, 2022 14:31
-
-
Save johnpierson/70cc69ba2471d547c230cfe2cf40149a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
linkTypes = UnwrapElement(IN[0]) | |
attachmentType = IN[1] | |
results = [] | |
TransactionManager.Instance.EnsureInTransaction(doc) | |
for link in linkTypes: | |
if attachmentType == 0: | |
link.AttachmentType = AttachmentType.Attachment | |
results.append("Changed to attached") | |
if attachmentType == 1: | |
link.AttachmentType = AttachmentType.Overlay | |
results.append("Changed to overlay") | |
TransactionManager.Instance.TransactionTaskDone() | |
OUT = linkTypes, results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment