Wall property "Function"

#1

Hi.
I’m exporting the type parameter “Function” to Excel, but all I get is 0, 1 and so on. I want “Interior”, “Exterior” and so on. What am I missing?

Thanks

0 Likes

Filter All Elements of Family Type selection by parameter
#2

@thomasarnoldsson5732 Could you show us your graph with values extended.

0 Likes

#3

0 Likes

#4

Inside CodeBlock write this.


Interior: 0;
Exterior: 1;
”;

0 Likes

#5

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

0 Likes

Door - Interior/Exterior Function Parameter
#6

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

1 Like

#7

Just as an extra information… The enumeration returns the different function types :slight_smile:
0 Interior
1 Exterior
2 Foundation
3 Retaining
4 Soffit
5 Core-shaft

2 Likes

Export Parameters to Excell based on Given List
#8

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

0 Likes

#9

just make a python script using if, elif and else for all six enumerations

item = IN[0]
lst = []

for i in item :
	if i == 0 :
		lst.append('Interior')
	elif i == 1 :
		lst.append('Exterior')
	elif i == 2 :
		lst.append('Foundation')
	elif i == 3 :
		lst.append('Retaining')
	elif i == 4 :
		lst.append('Soffit')
	else :
		lst.append('Core-shaft')

OUT = lst
1 Like

Wall type function is "Exterior" with python
Python Nodes Basics
#10

Thanks @erfajo worked great

0 Likes

#11

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

Johannes

2 Likes

#12

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.

0 Likes

#13

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

0 Likes

#14

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?

0 Likes

#15

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?
    "Exterior":
    WallFunc == 1?
	"Interior":
	WallFunc == 2?
		"Foundation":
		WallFunc == 3?
			"Retaining":
			WallFunc == 4?
				"Soffit":
				"Core-Shaft";
0 Likes

#16

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])]

0 Likes

#17

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

0 Likes

#18

Glad I could help. :smile:

0 Likes