Write parameter value as read only

i created instance project parameters and write values via coding, need to be read-only for obvious reason, in UI, you can use formula like “= 123” to make it read-only, how to achieve it in Dynamo/Python, i assume API’s SetValueString is the way.

1 Like

There are options in a Shared Parameter file i think

But a Key Schedule makes people think twice, that should do it

2 Likes

right, but i don’t want to use SP unless it’s the only way

What’s the “obvious reason” for locking down the parameter? This seems odd for a project parameter since you’d have to set the value for every instance and, as far as I’m aware, you can only use formulas in the family environment. Can you share more info on what you’ve done and what you’re wanting to accomplish?

value is calculated on the fly when creating that element (in-place family) via coding, user may modify that value afterwards which is not desired (because any other value is incorrect)

Railing along path - Revit - Dynamo

Right, but how are you applying a formula to project parameter on an in-place element? How would you do this via the UI?

Project parameters get created and assigned without a value, so you’d have to have at least one way to modify the value after the parameter is created on an instance by instance basis. This is where you suggested a formula, but formulas for parameter values are only available in the family editor. If you want to lock a dimensional parameter, you could create a dimension and lock the actual dimension rather than the parameter itself.

i need to figure out how to do it in coding (before or after that in-place family got created), no way to use dimension lock.

I don’t think what you’re asking is possible. That’s why I’m asking for a “manual” process first. If you can do it through the UI then we have a much better chance of “automating” that process through the API. If it’s not possible through the UI, then we know there’s not even an API option to automate.

Can you pin the elements? (and ‘educate’ your users?)

Make the shared parameter only accessible via the API. Revit API 2026 Documentation

2 Likes

SP works great.

1 Like