Set Parameter – Error Parameter is Read only

Hi,
I have got an error when setting parameter.
Sometimes I can change the level (or offset) of a fitting, but sometimes not (got “The parameter is read only” error).
Please help me to solve this issue. Thanks a lot!
https://forum.dynamobim.com/uploads/short-url/nXx0E9TH0nGaophuBppgIxbjkuc.mp4

Try to insert a Level.Name node after Levels

Hi Yna_Db, thanks for your suggestion.
It doesn’t work. I think this value should be a level object, not a string.

That’s right. In this case, I would guess that some element levels can’t be changed through Dynamo, but someone else could have a better answer…

Thanks Joseph_Peel,

Your solution is work.
I guess the reason is that we have “2” level parameters in Revit:
SCHEDULE_LEVEL_PARAM is for schedule, read only
FAMILY_LEVEL_PARAM is the writable property

So we need to assign what parameter we should change.
I have also update the python script source code as below:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
element = UnwrapElement(IN[0])
ref_level = UnwrapElement(IN[1])
offset = IN[2]

TransactionManager.Instance.EnsureInTransaction(doc)

for i,x in enumerate(element):
ref_levelid = ref_level[i].Id
object_param_level = x.get_Parameter(BuiltInParameter.FAMILY_LEVEL_PARAM)
object_level = doc.GetElement(object_param_level.AsElementId())
object_param_offset = x.get_Parameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM)
object_newoffset = offset[i]
object_param_level.Set(ref_levelid)
object_param_offset.Set(object_newoffset)
TransactionManager.Instance.TransactionTaskDone()

OUT = element

If we don’t want to use python script, we can follow the below picture:

3 Likes

@Orval_Tien Do you know how to change parameters of views as example “Perspective”? The Built in parameter is VIEWER_PERSPECTIVE_DISABLED. The value of perspective is No, I would like to switch it into YES. Is it possible with the node of Set Builtin Parameter of Archilab?