so if the length falls between a certain range say between 1000 and 2000 the syntax would be 1000<type1<2000?
This is the formula I wrote for the tags
Lintel 1, 2 and three are the different family types. Length is the length if the lintel, while length 1, 2, 3 are variables( say anything from 1 to 2000).
You aren’t giving it a parameter to read. Its looking for length and finding a family type. It can’t read the length parameter on its own.
Try something like this.:
First is having the script read data. As shown, you have ‘length’ as an input variable, but it has no relation to the family type you are working with. Look at GJax’s response for an example on how to retrieve the information you want to use (length).
The second is actually writing the revised data. As shown, you’re telling Dynamo ‘output a list containing either this family type or that family type’, but you need to tell Dynamo what to do with this list. Element.SetParameterByName is a companion node to GetParameterValueByName, it does what you logically think it would do. The parameter you want to change, if I remember correctly, is “Type”.
its giving errors. Length as you can see is 6100. So that is over 100. It should be changing it to type 1 or 2. Almost there I believe but its not changing the lintel to type one or 2. This problem it must select lintels of type 75x75x8ea
What basicly happens is that each element has a list of parameters and you want to change them, depending on the length. That is what Element.SetParameterByName does, it sets the paramater with name Type to your selected type followed by the IF statement.
thanks @GJax89 and @Rickkrrd. Now one doesnt manually have to change to the correct schedule! The run of dynamo is like a football match and thats confusing if you dont know what comes before and after.
is there any way to make the length parameters more editable? currently its sitting like this in the code block. Instead of the 1550 rather put say length 1
Quick example, you would replace the string list with your family type list (note that I added a 0 condition at the end of the list for this to work). You could also build a dictionary and reference the dictionary pairings.