How to delete multiple family parameter from inside the project

revit
python
dynamo

#21

Dear all,

I am so sorry that I totally did forgot that I actually made this node some time ago :-S

I have made so many solutions to a broad variety of things, I apparently also have begun to lose track over all the nodes.

It has been rather busy for me to “leave” the community. I have had to make much enhancement to my Github and Dictionary. I have made a total sample collection, meaning traversing all my nodes and reused as much I could from all the solution I have given in this community. In that work, I focused on one node at the time and apparently I forgot again when I moved to the next node. I am so sorry about that.


#22

Dont know what causing this error


@Mark.Ackerley


#23

That’s a new one to me! Is it a clockwork node? Perhaps message the package creator?

Sorry,

Mark


#24

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…


#25

@shrawanram
I have a sample that show how to handle category to family documents…


#26

@erfajo That would be helpful for me .
Can you share ?


#27

hi @shrawanram, you can use this script to delete project parameters by their names.

#(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

#28

please see my profile…