How to set a walls height constraint parameter using python

Hi

Im trying to set a walls height paramet using the following code:

TransactionManager.Instance.EnsureInTransaction(doc)
param=UnwrapElement(elements)[0].LookupParameter(“Restricción superior”#translation:wall height constraint)
param.Set(“5”)
TransactionManager.Instance.TransactionTaskDone()

But im getting : File “”, line 43, in
Exception: The parameter is read-only

Is there any way to set parameters using python , just as you would using setParametersByName dynamo node?

Thanks

Resolved:
#Get levels
lvl_list=FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).WhereElementIsNotElementType().ToElements()

TransactionManager.Instance.EnsureInTransaction(doc)
param=UnwrapElement(elements)[0].LookupParameter("Restricción superior"#translation: top level wall constraint)
param.Set(UnwrapElement(lvl_list[2]).Id)#set the wall constraint with level id
#(elements)[0].SetParameterByName("Restricción superior",)
TransactionManager.Instance.TransactionTaskDone()
#param_name=elements[0].Parameters[28].Value



OUT=elements[0].Parameters
1 Like