I would advice looking towards the Orchid package which have tons of nodes for working with families instead of using a custom python script written to work on active document
@Jonathan.Olesen I found orchid package very useful but remove parameter works fine just inside Family.
Cannot delete from the projects to all family parameter.
@shrawanram, I forgot to mention the “Element.ElementType” node, so i updated the picture above. @erfajo, I didn’t know you had a similar node (you’re package keeps getting better ).
Think your error is that the all elements of category node you’re using is returning a function as you have not supplied it with enough information to run…
#(should be fine with 1.3.x or 2.x.x versions)
import clr
clr.AddReference('RevitAPI')
clr.AddReference("RevitServices")
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# input[0]
elements = IN[0]
# params id
todelete = []
# check/make list
if not isinstance(elements, list):
elements = [elements]
# collect parameters
parameters = FilteredElementCollector(doc).OfClass(ParameterElement).ToElements()
# loop input params
for elem in elements:
# loop existing params
for param in parameters:
# if name found
if param.Name == elem:
# append id to delete list
todelete.append(param.Id)
# start transaction
TransactionManager.Instance.EnsureInTransaction(doc)
# delete from document
res = [doc.Delete(i) for i in todelete]
# end transaction
TransactionManager.Instance.TransactionTaskDone()
OUT = res