Is it possible to change the Room Calculation Point for all families in a project?

Had a play on my flight back to Toronto - This one will remove the need for List.UniqueItems :slight_smile:

import clr
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

# Collecting all placed Family Instances
collector = FilteredElementCollector(doc).OfClass(FamilyInstance).ToElements()

# Collecting the Family Type from each Instance
familyTypes = [c.Symbol.Family for c in collector]
# Collecting their Room Calculation Point parameter information
roomCalcPoint = [type.LookupParameter('Room Calculation Point').AsInteger() for type in familyTypes]
# Filtering this list with only Family Types that have the 'Room Calculation Point' turned off
famsRoomCalcOff = [type for type, roomCalc in zip(familyTypes, roomCalcPoint) if roomCalc == 0]
# Get the Element Id for every family in the filtered list
famId = [fam.Id for fam in famsRoomCalcOff]
# Creating a Dictionary for every pairing we have between Element Id's and Families. Because dictionaries have to have a unique key this gives us the ability too collect 'unique items'. 'Set' doesn't work due too the nature of Element Id's
famDict = {key:value for key, value in zip(famId,famsRoomCalcOff)}

OUT = famDict.values()
3 Likes