# REVIT ---RFA original parameter

**URL:** <https://forum.dynamobim.com/t/revit-rfa-original-parameter/101488>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [May 31, 2024, 4:08am UTC](https://forum.dynamobim.com/t/revit-rfa-original-parameter/101488 "2024-05-31T04:08:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pyXam](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pyxam/32/163009_2.png) [@pyXam](https://forum.dynamobim.com/u/pyXam)\
**Post date:** [May 31, 2024, 4:11am UTC](https://forum.dynamobim.com/t/revit-rfa-original-parameter/101488/2 "2024-05-31T04:11:56Z")

</div>

Something here i think.

Source: [Looking for node to modify Parameter in \*.rfa file - Revit - Dynamo (dynamobim.com)](https://forum.dynamobim.com/t/looking-for-node-to-modify-parameter-in-rfa-file/19487)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/1/0108beac9e7a4572bf70ea50d79aa005b84753ff.png)

```auto
#REF https://forum.dynamobim.com/t/looking-for-node-to-modify-parameter-in-rfa-file/19487?u=pyxam

import clr

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

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

# class for overwriting loaded families in the project
class FamOpt1(IFamilyLoadOptions):
    def __init__ (self): pass
    def OnFamilyFound(self,familyInUse, overwriteParameterValues): return True
    def OnSharedFamilyFound(self,familyInUse, source, overwriteParameterValues): return True

def changeParam(f1,name,make,result):
	famdoc = doc.EditFamily(f1)
	try: # this might fail if the parameter exists or for some other reason
	    trans1.EnsureInTransaction(famdoc)
	    par_name = [a for a in famdoc.FamilyManager.Parameters if a.Definition.Name==name][0]
	    if make == True:
	    	famdoc.FamilyManager.MakeType(par_name)
	    else:
	    	famdoc.FamilyManager.MakeInstance(par_name)
	    trans1.ForceCloseTransaction()
	    famdoc.LoadFamily(doc, FamOpt1())
	    result.append(True)
	except Exception, e:
	    result.append([False,e])
	    trans1.ForceCloseTransaction()  
	famdoc.Close(False)

def unwrapping(ele):
	try:
		f1 = UnwrapElement(ele.Type.Family)
	except:
		f1 = UnwrapElement(ele)
	return f1

trans1 = TransactionManager.Instance
trans1.ForceCloseTransaction() #just to make sure everything is closed down
# Dynamo's transaction handling is pretty poor for
# multiple documents, so we'll need to force close
# every single transaction we open
result = []
if hasattr(IN[0], " __iter__") == True and hasattr(IN[1], " __iter__") == True:
	for i in range(len(IN[0])):
		f1 = unwrapping(IN[0][i])
		changeParam(f1,IN[1][i],IN[2],result)
elif hasattr(IN[0], " __iter__") == True and hasattr(IN[1], " __iter__") == False:
	for i in IN[0]:
		f1 = unwrapping(i)
		changeParam(f1,IN[1],IN[2],result)
elif hasattr(IN[0], " __iter__") == False and hasattr(IN[1], " __iter__") == False:
	f1 = unwrapping(IN[0])
	changeParam(f1,IN[1],IN[2],result)

OUT = result

```

---

_[View the full topic](https://forum.dynamobim.com/t/revit-rfa-original-parameter/101488)._
