Wall property "Function"

Inside CodeBlock write this.

Interior: 0;
Exterior: 1;

0 & 1 usually represent a Yes/No parameter… i don’t know if that is the case with you but if it is then you can do this

Looks like @Mohammadz myself replied at the same time :smile:

1 Like

Works as long as it is just 2 alternatives (Y/N) but here it is 6 alternatives just as @erfajo wrote.

Thanks @erfajo worked great

… and if you don´t like or know python, try this:



Hmmm. In version 1.3.1 running in Revit 2018.3.1, the Function parameter appears to not be accessible. I’ve listed the parameters and the “Function” does not appear in the list. Furthermore, attempting to list the parameter values by name yields blank items in the list. What am I missing here? Does this depend on another package to read, or python? Is it resolved in a later build of Dynamo? I’m hoping it doesn’t.

The parameter name is case-sensitive. Do “Function”, not “function”.

I thought so too, and had tried both based on what others have posted. Listing of parameters does not show any version of it. Hence, the parameter is missing and orherwise inaccessible from what I can see. Any other advice?

Function is a type parameter, not an instance parameter.

Add an Element.Type node (I prefer the one in the Rhythm package) and you should get what you’re after. Alternatively, you could use a code block like this:

WallFunc = a.GetParameterValueByName("Type").GetParameterValueByName("Function");

WallFunc == 0?
    WallFunc == 1?
	WallFunc == 2?
		WallFunc == 3?
			WallFunc == 4?

I would have used the AsValueString() method somehow. (There is probably a node for it in some package). Here is an one liner example python:

OUT = [w.LookupParameter('Function').AsValueString() for w in UnwrapElement(IN[0])]

@jacob.small, your code block definition works beautifully. The concept and application of conditionals is clear and concise. Thanks so much!

Glad I could help. :smile:

digging this one up as I’m stumped on why neither of the three Set Parameter nodes shown here will push the value into the collected Types Function parameter.
Quantities differ between the two selection methods, and all of the subsequent lists are as expected, but Type Function remains unchanged after running script in dynamo 2.0.3

Hello @Johannes_Meiners, did this node get removed? I’ve been using it in Dynamo 2.3 but now I am in Dynamo 2.5 and I can’t find it

Assuming you are looking for WallType.Function, this can be found in the Clockwork package.

1 Like

or a way with ootb nodes…


thank you @jacob.small and @sovitek

1 Like

It is possible to use the System.Enum methods to get values and objects from the Revit enumerations

import clr
import System

from Autodesk.Revit.DB import *

value = 1
OUT = System.Enum.GetName(WallFunction, value)
# 'Exterior'
OUT = System.Enum.GetNames(WallFunction)
# 'Interior', 'Exterior', 'Foundation', ...

You can also use this method to get built in items for filters

bic = System.Enum.ToObject(BuiltInCategory, elem.Category.Id)