Conditional functions


#1

Hi Everyone,

Following a previous topic I created some days ago, is there a way to add conditions such as, if something is bigger than a value, then these components are working, otherwise no.

If the object has a certain size, it has to be cut in many parts (this problem was solved in a previous topic), and there need to be some elements which appear to connect them.

It works perfectly with two or more elements, it multiplies at the correct place but if there is only one element these connecting elements also appears.

Something that i found was the component bigger than, but it can’t un unset functions…

Any idea of how to do?

Thanks in advance for your help!

Paul


#2

Where is your GH code? What was the previous topic? This one?


#3

Hi, sorry, here it is:

https://discourse.mcneel.com/t/step-division/53878

(first component point has to be assigned to a point to work)

Base.gh (28.3 KB)


#4

missing

missing2

:zzz:


#5

(first component point has to be assigned to a point to work)


#6

SO EASILY AVOIDED… sigh.

missing3

I don’t remember what the problem is anyore, but it’s somewhere in this area:


#7

About the point i will know for next time. :wink:

There is no problem in the file, the initial question was about the existence of a component that would allow to create conditional component, that would only work if a specific question was fulfilled


(Aris Nikolopoulos) #8

Hi,
If (condition,value if true,value if false)
if.gh (7.9 KB)

*correct question should be “is x bigger than 3?” my bad.


(David Rutten) #9

Relay is a standard Grasshopper object in Rhino6.


#10

Non-standard use of <kbd> tags! Besides, there are many ways to answer his question, including Larger, Smaller, Equals, Dispatch, Cull, etc.

I know, just saying… there is a fork in the road and the two paths (Rhino 5 vs. Rhino 6) are diverging.


#11

Ok, i got the point, but how do you able or unable a function with a True/False or Yes/No value.

Let say i want to make a circle only if “X” is over 4. How do I link both? see enclosed example.

if.gh (5.4 KB)


(Aris Nikolopoulos) #12

sorry, I’m busy at the moment and I need to have a closer look to your definition to understand completely what you want. (If nobody else helps you I’ll be back tonight)
but from the top of my hat I would say make the circle anyway, and feed it or not to the rest of your definition.


#13

Hi Paul,
One option is to use the Stream Filter component.


#14

Thanks Sridevi! It’s exactly what i was looking for :grinning: