HOW I can change original parameter
Instance Parameter ,Type Parameter
This is different RFA
Something here i think.
Source: Looking for node to modify Parameter in *.rfa file - Revit - Dynamo (dynamobim.com)
#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