I couldn’t separate the boxes I wanted. How should I separate them? Can you help? I got help from Gemini but it didn’t work
You’re better off using Cull Index here, it does the opposite of List Item
It really happened, thank you very much
“Dispatch” is the weird name for a plain stupid If-Statement (or conditional branch). I remember, while learning GH, that I wondered why there is no “if” in Grasshopper.
Dispatch is my favorite component ![]()
Use an expression to implement 'if. Use a parameter component, if necessary.
No GH file @sefa_cebe
On ignore for you! ![]()
Its an expression component or a poormans script. Sure you can also write a script component and have an if. But this involves evaluation and will lower the performance significant. Given that in every language the if statement is probally the most important keyword, its surprising that there is no simple ‘if’ component. If you know how to code and you learn Grasshopper later, this is super confusing.. Same that it lacks recursion (loops etc).
if we talk about if then we might choose
else
we might chew up the sorting in the list
Sift is equally confusing. In most languages this is a filter with a (filter-)predicate. In SQL you could also use select by condition (select-where). But sift is quite unique. While this is highly theoretical, it would have helped people to transition from or to scripting when the naming would somehow match. My point is more or less the confusing naming in Grasshopper…
totally agree on this.
This is my biggest point of critique on grasshopper - it doesn’t teach common programming practice and patterns. Grasshopper and it s datatrees violates against many concepts of object orientated programming. At a certain level of complexity the spaghetti monsters are unreadable for a third person or for their creators after a few month.
There are many people that master datatrees on an impressive level. - But - Spending their brain power to problems that can be solved with a few readable lines of code.
i am always wonder, why topics that address those issues do not get more attention.
for example my wish for more robust clusters that allow ObjectType and Access (Item,List,Tree) Signature:
cheers - tom
Let me be the “old grey man” here and try to speak some wise words:
- Not so polite to hijack this thread for another discussion, then about the question asked: “How should I use Dispatch” If you want to talk about your differences between Grasshopper and other ways of expressing your selves, you better move it to your own new thread.
- Maybe I will start a thread in this forum, why in Grasshopper the rules about “voice-leading” and “part-writing” are not used as you might expect coming from a musical background. Or maybe better not.
Have a good day, regards, Eef
Scripted operations usually run faster than vanilla gh.
But I think more fundamentally Grasshopper appeals to people who are moving from CAD into scripting not moving from scripting into CAD - I would not expect people who know how to code to have any problem with either dispatch or sift and both are pretty fundamental concepts in gh.
I’d love to know how many people came to Gh after writing SQL - I have a feeling it’s a pretty small group, but probably not as small as the group that went from Gh to SQL.
I get the point, but I believe once you understand that you can use it as an If statement, I think it’s obvious how to use it. I think it’s also helpful to see alternatives. Although I agree the topic leaves a bit the original indents.
The performance gain on scripts is due to the ability to shortcut and do things in one loop. But every input is copied (I know there are hacks), but this alone is a drawback. A precompiled dispatch/if must be faster than alternatives (at least on large datasets)
SQL is used in any programming language as soon as you access a relational database. Every developer who uses this, sooner or later will have contact with SQL. C# Linq is an abstraction of it, but you find Python libraries doing the same. GH programmers are rather a microscopic group in programming if you will.
100% the case here. I’ve dabbled in programming (with very occasional success) for nigh on 40 years, starting with ZX Spectrum Basic, but it’s never really stuck. I think it’s just one step too far abstracted from concrete results for my brain to hang on to. GH’s visual metaphor for the flow of data has let me do more computational geometry in the last 18 months than the whole of the rest of my life.
A gain is still a again - it doesn’t lower performance. I have never been affected by the inputs being copied - is 0.2ms really making a difference in your scripts?
This isn’t relevant to most people working in Gh and list management in grasshopper is considerably more intuitive than SQL
Applying common concepts and naming might help to identify problems. It’s not that I’m saying SQL uses better terms, I’m saying if you use common language, you might identify problems more easily and you can apply your knowledge outside of the bubble. It doesn’t matter if you never plan to leave it or entering it without any former programming knowledge. Common naming just opens a bigger world to you.
And the problem I mentioned with scripts is data duplication, which of course is not a problem on small and primitive datasets, but you claim scripted operations usually run faster. But for a simple if statement, without any further logic in, it cannot be true. Of course if you bypass GH you often become faster. The entire performance discussion was more or less meant as a hint and shouldn’t emphasize my point





