Retrieve level from element
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
confused by this one.
I have elements in a model (mechanical devices). I can set up a schedule including "Level" and the level comes up fine.
In Dynamo I set up a script that gets (by category) all mechanical devices, and this feeds into GetParameterValueByName with "Level" as the input to the parameter name. This properly returns a list of levels.
All good so far.
But in C# this code returns "Unknown" :
Parameter levelParam = element.LookupParameter("Level");
string levelName = levelParam != null ? levelParam.AsString() : "Unknown";
I've written some code to display all the parameters of the element along with the value and Level is listed, with the proper value.
Why should this work so easily in Dynamo but not in C#?
Thanks for your advice.