set value to a Read-only parameter

set value to a Read-only parameter

Anonymous
Not applicable
1,779 Views
2 Replies
Message 1 of 3

set value to a Read-only parameter

Anonymous
Not applicable

I have an familytype ant its category is "electricalEquipment"

then the family instance has a parameter "Instacance_elevation_param"

when create instance in Revit, I can modify the parameter

but after confirm it then the parameter is read-only

 

then my question is : how I can set the parameter in code

document.create.newfamilyinstance(); (I have try to set the location XYZ  but useless)

Thanks

0 Likes
1,780 Views
2 Replies
Replies (2)
Message 2 of 3

lukaskohout
Advocate
Advocate

Is the parameter created by user in the family or is it built-in parameter?

 

Could you post some screenshot and maybe the family of Electrical Equipment?


Hitting Accepted Answer is a Community Contribution from me as well as from you.
======================================================================
0 Likes
Message 3 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

Are you trying to set the instance parameter value to an element before creating/placing an element in the project?

Please note that the instance parameter is accessible via API only after creating an element instance in the project.

1)create a transaction

2)place an element in the project

3)commit the transaction(An instance element is created)

4)Create one more transaction

5)Modify parameter value

6)Commit the transaction

 

Also, check for the parameter's properties before modifying the parameter.

If the parameter value is read-only then the value of parameter cannot be changed via API.

Some parameters are read-only but User-modifiable which means the parameter value can be changed via UI but not via API.

 

Here is the recent discussion

https://forums.autodesk.com/t5/revit-api-forum/modify-key-source-parameter/m-p/9592801#M47989 

 

I hope this helps.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes