New to Python: "Exception: The symbol is not active" error

Hi @Figleggedtom

Error says that your family symbol is not active in the current document. You can solve this by 2 methods. Here is the process in action:

and the script here:

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


import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)


import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB.Structure import *

doc = DocumentManager.Instance.CurrentDBDocument
famtype = UnwrapElement(IN[0])

elementlist = list()

TransactionManager.Instance.EnsureInTransaction(doc)

# To Make sure the familysymbol is active

if famtype.IsActive == False:
famtype.Activate()
doc.Regenerate()

for i in range(0,100,10):
newobj = doc.Create.NewFamilyInstance(XYZ(i,0,0),famtype,StructuralType.NonStructural)
elementlist.append(newobj)
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist

Cheers!

13 Likes