I am trying to set parameter “Rebar Cover - Exterior Face” to a wall.
I can get this parameter but when i try to Set it to a different value it gives me this error: “1. Failed to cast from Text to ElementId.”
Thank you for your reply.
Sure… In the grasshopper file i internalised the data but there is also the revit file if you want to open it too. Project1.rvt (6.7 MB) Script.gh (9.3 KB)
I have looked into your file. RebarCover Exterior parameter looks like a select parameter. There are options and you can select only one of them. Since it is not a text or number parameter, I haven’t been able to solve this issue.
Rebar Cover Types are DB.Structure.RebartCoverType in Revit API and they are actually a kind of element types. The “Rebar Cover - Exterior Face” parameter doesn’t store the name. It stores the element id to the rebar type - hence the error “can not convert from text to element id”
You need to query these types and provide that as the input to parameter setter. I’m showing two methods of querying here. One using the API type and a value selector, and another using a custom python component: