Set Parameter – Error Parameter is Read only

archi-lab
clockwork
revit
#1

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://discourse-cdn-sjc1.com/business6/uploads/dynamobim/original/3X/a/7/a7ecc494f9e6baa68f468a99c2cae35037c58298.mp4

0 Likes

#2

Try to insert a Level.Name node after Levels

0 Likes

#3

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

0 Likes

#4

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…

0 Likes

#5
0 Likes

#6

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

0 Likes

#7

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

2 Likes

#8

@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?

0 Likes