Delete Project Parameter from model


#1

Hello Guys,

I am trying to create dynamo to delete unwanted project parameters from revit model.
I have prepared below dynamo script, but it is not working.
Could you please help me?

FYI: I am using Dynamo 1.2 & Revit 2015.

Thank you for your co-operation.

Deleter Project Parameter_WIP.dyn (7.6 KB)


#2

That nodes needs Elements currently you’re feeding strings to it.

Hint: Use element types and get the parameterelements from it and filter parameterelement by parameter name.


#3

Hello Kulkul,

Thank you for your quick response.
I could not find out ‘ParameterElement’ in ‘Element Type’ node. Refer below image.


#4

Hello Guys,

Could you please help me to resolve this issue?

Thank you in advance.

Regards,
Nilesh Katkar.


#5

If you want to delete project parameters, then try to see my package…


#6

@nileshkatkar1983in , try this;

# dynamo version - 1.3.2
#(should be fine with 1.3.x or 2.x.x versions too)

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

#7

Hello Erfajo,

Thank you for your replay.
I am using Revit 2015 & Dynamo 1.2, So shall i use this updated package in Dynamo 1.2?

Thank you.


#8

Hello Sean,

Could you please upload here Dynamo graph?
Because i tried to use your Python script but no luck (Might be i am doing something wrong).

Thank you.


#9

@nileshkatkar1983in , there you go remove-project-parameters.dyn (2.6 KB)


#10

Hello Jean,

Thank for your quick reply.
I used dynamo graph to delete lighting fixture project parameters.
But it is showing warning.
Please refer below image.

Thank you.


#11

@nileshkatkar1983in, you are having Revit API Class (ParameterElement) Importing Error,so here is updated version (another way of importing classes) remove-project-parameters.dyn (2.7 KB)
. Try this one and let’s see if Ok or not.


#12

Hello Jean,

Thank you for your efforts.
I run updated script but is showing warning.
Refer below image.


#13

I am sorry but I dont support Revit 2015 anymore. My nodes will most likely not work while they are build to support Revit 2017 as minimum. It can support Dynamo 1.2, there is a post how to do this in the forum somewhere.


#14

Hello Erfajo,

Noted.
Many thanks for your efforts.