Working of if-then


Added is a small part of a bigger model where there are 2 lines, a and b, and a flexible curve c.

Line d is at the shortest distance between the part of curve c at the righthand side of point B and line a.

See sketch 1.

But when the form of curve c is changed in such a way that the shortest distance and so line d become equal to A-B as shown in sketch 2, line b should be offset a certain distance from point B to the right as shown in sketch 3.

The point is that I can’t find a way to make the offset work when point D=B.

I tried dispatch and other ways, but still don’t see the light.

Anyone who can help me?

simple form.3dm (5.1 MB) simple (7.1 KB)

Moved to Grasshopper

Hello -so your goal is to determine of the X of the line end points are the same as the X of A and B and off set the line if they are the same, correct?


like this? simple (10.6 KB)

My guess is that you want to "move line b to the right until there is a closest point D which is not coincident with B".

If this is the case, it can only be done through looping (i.e. Anemone, Hoopsnake, OctopusLoop, Scripting).

If you want a static solution with simply a fixed amount of offset, the solution @ME_Mark posted is the way to go about this.

Indeed, I think I misread the question. :sweat_smile:.

Hallo, you people are really fast. As far as I can see, the proposal ME_Mark did is exactly what I was looking for. Now I’ve only got to find why it works this way.
Thanks a lot.

In the light of the new information, it seems I was the one misreading :wink: