Getting Dynamo to select 'Include element in links' for schedules


#1

Hello All,

Very new to Dynamo but I have a project which has had hundreds of schedules created but set up incorrectly. I’ve managed to get to the add / remove and sort parameters but cant find how to automate the ‘include elements in links’ check box in the schedule properties dialogue (image below).

image

Is there something I’m missing here? Any help greatly appreciated.


#2

Hello,

I have the same issue right now. Does anyone know how to do it with any node or with python?


#3

This can be achieved with a bit of Python. Create a Python script node and paste the code below. It takes a list of schedules as an input.

Not all schedules have the ability to include linked files (e.g. keynote legends) so the output has a list of the schedules accompanied by a report of booleans to show whether it was successful or not

# Enable Python support and load DesignScript library
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

schedules = UnwrapElement(IN[0])

out = []
report = []

for schedule in schedules:
	if schedule.Definition.CanIncludeLinkedFiles:
		try:
			TransactionManager.Instance.EnsureInTransaction(doc)
			schedule.Definition.IncludeLinkedFiles = True
			TransactionManager.Instance.TransactionTaskDone()
			out.append(schedule)
			report.append(True)
		except:
			out.append(schedule)
			report.append(False)	
	else:
		out.append(schedule)
		report.append(False)

OUT = out, report