Element Set Parameter Value: Cannot Cast String to Element ID


In Dynamo it is possible to set the value of a parameter that is not an integer. For example if I wish to set the ‘Base Constraint’ of a wall, the error ‘Cannot Cast String to Element ID’ occurs. Of course, when I use an integer to adjust the ‘Unconnected Height’ there are no issues.

Am I missing something? Is there a way to cast a string to an element ID to change a string parameter?

err.gh (8.0 KB)

Hey @brobes05
You need to use the Document Levels component to select a level and pass to the Set Parameter


The problem is Base Constraint is not a string parameter, it takes the Level ElementId.
Same happens in Dynamo.

The problem with an automatic casting from string is that is not easy to determine this parameter is referencing a Level in a generic way, so this would force us to implement those kind of automatic castings, parameter by parameter, and there are a lot.

Query Levels gives you all Levels or the requested Level if you filter by Name.

Hi, I have a similar problem trying to set the top constraint level of a wall using set element parameter. I get this error text : “RhinoInside.Revit.GH: Failed to assign an element from a diferent document”

I never had this error before so i guess it has something to do with the v0.0.7683.19842 update ?

1 Like

This has been fixed in the latest release