How to delete multiple family parameter from inside the project

I have 50 mechanical equipment inside the project.
I am trying to delete all listed parameter of all families from inside the project.

THis script works fine inside the family . How to workable from projects also.

Need help.

Thank you.

Capture project.

REMOVE PARAMETER From project.dyn (2.6 KB)

1 Like

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 :slight_smile:

1 Like

@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.

Do you have any idea .

Thank you.

You can visit www.revitapidocs.com and check for a method to delete the project parameters unless someone in here can remember it :-).

EDIT: Try have a look at this tread. It is written in C#.
https://forums.autodesk.com/t5/revit-api-forum/deleting-a-non-shared-project-parameter/td-p/5975020

Hi @shrawanram,

I’m not exactly sure what you have in mind, but maybe the “Orchid” node below can help you.

EDIT: the picture above is updated (initialy forgot the “Element.ElementType” node).

Kind regards,
Mark

1 Like

Hi,

If you haven’t found a better approach yet, you might consider this…

It deletes parameters from multiple families in a folder.

You might need to save out your project families and then reload them.

Hope that’s useful,

Mark

FamilyParameterDelete.dyn (6.9 KB)

1 Like

@MJB-online

I got Error message on Beaker Package


Warning: One or more of the input types are not matching. Couldn’t find a version of GetFamilyDocument that takes arguments of type (__array)

and for orchid package:
Warning: Parameter.Delete operation failed.
Please run this command in a family document.

@CVestesen
Thank you. But still too high level for beginners.

@erfajo

just trying,
Do you have any nodes that works for inside project ?

@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 :+1:).

Kind regards,
Mark

1 Like

@MJB-online
Just remind you that i am working on Project not in revit family.

i GOT ERROR IN PARAMETER.DELETE NODE (ORCHID)

**Warning: Parameter.Delete operation failed. **
**Value cannot be null.**
**Parameter name: familyParameter**

Any help will be appreciated.
Thank you.

@erfajo
I will put some issue in github .

Hope it will solved soon.
Thank you.

@shrawanram,

  • I know you are in working in project environment (me to, and it works fine for me).
  • When i am testing Dynamo graphs that open families (in background), i frequently restart Revit and Dynamo.
  • When you want to edit 366 families, you also need to create a list with 366 filenames for input of the “Document.SaveAs” node (not just one).

@MJB-online

is there any other way to do it ?
it will make me 366 save as node for family. ?

Hey,

This works for me…

It runs from the project, saves out the families, edits their parameters then reloads them.

The only quirk is that I couldn’t get my Orchid File Load to work. This might be something to do with my setup.

Hope that helps,

Mark

FamilyParameterDelete-2.dyn (23.8 KB)

1 Like

Dont know what causing this error
image
@Mark.Ackerley

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

Sorry,

Mark

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…

1 Like

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

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
6 Likes