If/ then


#1

 

 

I’m stuck on an if/then statement! The XYZ distance node supplies a list of distances. I want to make sure none of those distances are less than 1 and if they are less than 1, than make it 1. However, the less than node is giving me an error “malformed ‘less-than’”

 

 

 

 

 


#2

Ah, perfect. Once again, thank you.


#3

The Create Extrusion Geometry node processes each LIST of curve loops (profiles) as a a single solid. So, multiple profiles that are each being extruded are treated together as a single element. This is done to efficiently make lots of stuff. However, this means that if you want to deal with each individual curve loop differently, they need to each be put in a separate list. See image




#4

Thanks guys. I now have a related issue!



I'm trying to use the Create Extrusion Geometry to create an array of extruded "rods" where each rod in the array is a different length based on a list supplied to the distance port.



I've tried all of the lacing options but cannot seem to get the result I am looking for. For example, the 'longest' option treats the entire list of loops as one entity and applies each distance, in the list of distances, to the entire array of loops, instead of concatinating the individual loops with the individual lengths. The result is that the entire array of extrusions is repeated, where all rods in each array match one of the legths in the list of distances.



Any advice is greatly appreciated!




#5

Great, thanks. I'


I really like how dynamo handles lists, but don't fully understand the lacing concept. Is there a good article on this?


#6

You can also use the formula node to do if/then syntax, if that is your bag. In this case, it would be if(x<y,y,x) or you could also do if(x<1,1,x) for more simplified ports if you don't need to parameterize your threshold of 1.



#7

The less-than node does not have lacing, so it's trying to compare the list coming out of XYZ Distance with the number 1, which doesn't make sense and results in that error.



You can accomplish what you want by using a Formula node: