Hey all,
Trying to filter a list of all furniture and furniture system families (types/FamilySymbol, not instances) in a project down to only types that have an associated Type Mark. I’ve tried many different syntax methods, but I still end up with a few “blank” values in my list. I use quotes around blank because the logic is filtering out null values, so there must be a value, but I cannot figure out what it would be. If I go to the family types in question, the field is blank, and there’s nothing in the parameter value field to delete.
Any ideas as to what’s going on?
Edit: Inputs can be ignored. I removed the rest of the script as to not be confusing - I’m automating the create of furniture schedules later on down the script.
# Enable Python support and load DesignScript library
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
from DSCore import List
clr.AddReference('RevitNodes')
from Revit.Elements.Views import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# The inputs to this node will be stored as a list in the IN variables.
fieldnames = IN[0]
prefix = IN[1]
texttype = IN[2]
phase = IN[3]
phasevis = IN[4]
fieldslst = []
fieldnameslst = []
schedules = []
output = []
errs = []
# collect furniture and furniture system familysymbols from document
collector1 = FilteredElementCollector(doc)
filter1 = ElementCategoryFilter(BuiltInCategory.OST_Furniture)
filter2 = ElementCategoryFilter(BuiltInCategory.OST_FurnitureSystems)
ffefilter = LogicalOrFilter(filter1, filter2)
types = collector1.WherePasses(ffefilter).WhereElementIsElementType().ToElements()
for type in types:
typmrk = type.get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_MARK)
if typmrk.HasValue == True and (typmrk.AsString().startswith(' ') or typmrk.AsString().startswith('')):
output.append(typmrk.AsString())
# Assign your output to the OUT variable.
OUT = output