I have just encountered this issue, which is pretty weird:
Here’s the code, I have the API loaded:
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
x, y, i = 0, 0, 0
xList, yList = [], []
types, ids = [], []
detItemTypes = IN[1]
def getDetItemType(elemName, itemsList):
if "FHF" in elemName:
return(itemsList[0])
# elif ""
for entrance in IN[0]:
x += 50000
y = 0
i = x
for level in entrance:
x = i
y += 1500
for apartment in level[0]:
x -= 1500
for elem in apartment:
xList.append(x)
yList.append(y)
x -= 500
types.append(elem.Symbol)
ids.append(elem.Id)
x = i
for apartment in level[1]:
x += 1500
for elem in apartment:
xList.append(x)
yList.append(y)
x += 500
types.append(elem.Name)
ids.append(elem.Id)
OUT = xList, yList, types, ids
This is the line, that throws the exception:
types.append(elem.Symbol)
What could be wrong? This is the standard way of getting the FamilySymbol from a FamilyInstance… Those family instances are all Mechanical Equipment in this case, not that it should matter…