Cull Pattern indices and Group Component

Ref to marked area and files attached

GH:
cull.gh (44.6 KB)

IMG:


  1. Why are the indies not accepting the syntax demonstrated in the image? Is it possible to approach this problem using {} () format - NOT ( 0 to…) or using Series component?

I understand the answer provided by an agentic ChatBot. So there’s no way to work around the way I intended?

Short answer: that syntax isn’t valid in Grasshopper. Cull Index expects actual integers in its I (Indices) input, not a formula in the panel. The fix is to generate a proper list of indices and plug that into I.
	
	What’s going on
	- Cull Index’s I input takes integers; it doesn’t parse expressions like “-[*](1 to ?)” from a panel. It just sees a single text value and fails. Official docs show I’s param type as “Integer” (meaning a list of integers).【turn5fetch0】
	
	How to do what you wanted (a range of indices)
	- If you wanted “all indices from 1 up to N” to be removed, generate that list and feed it into I. Two easy ways:
	
	1) With a panel (simple, explicit)
	- Double-click a Panel and type the indices on separate lines, e.g.:
	
	  1
	  2
	  3
	  4
	  5
	
	- Set the Panel’s type to “Data” (right-click the panel > Data), then plug it into Cull Index > I.
	
	1) With components (dynamic, recommended)
	- Use Series to make an integer list and connect it to Cull Index > I:
	
	  • Series > S (Start) = 1
	  • N (Step) = 1
	  • C (Count) = however many indices you want to remove (or compute it from List Length − 1)
	
	- Series generates [1, 2, 3, …, C] which is exactly the kind of integer list Cull Index expects.
	
	If you meant a reverse/“down to” range
	- Grasshopper panels don’t support “1 to N” or “N to 1” syntax at all. Use components:
	  - To cull indices from N down to 1 (e.g., 10..1), make a Series from 1 to N and then Reverse List before plugging into Cull Index > I.
	
	Note about negative indices
	- Cull Index expects positive indices (0-based). Negative-index syntax (like Python’s -1 for last item) isn’t supported in Cull Index. Use explicit positive indices or compute them from the list length instead.
	
	So, remove the formula from the panel, give Cull Index an actual list of integers, and it will work.
  1. Why does it must use a group component? Isn’t a branch considered a ‘group?’ At the very least, clicking the voronoi component in this case selects all objects, indicating that it is a group.

could you please explain what are you trying to achieve?

I came up with the questions while I was simply exploring GH.

GH works with Lists, and data trees are just Lists of Lists

using Group component sort of simplifies the data tree because it transforms the last nested Lists into items called Groups (and while doing that it prunes one level of the data tree itself)

looking at your question and noticing the thought behind it, I think this playlist would be very interesting for you because it explains super well data trees:

after the above, this is also a super interesting and instructional video about data trees:

Here’s the problem I had:

Do you know why ‘Remove Empty value = False’ by default, while the others are True? I just realized this after looking into the Boolean Setting.

New Question:

Do you know how to assign several aliases to a GH component? For example, assign ‘l’ and ‘lis’ to the LIST component.

YT link

What is the title name of the first YouTube URL?

There is no simple and minimalist solution to Cull indexing or any other indexing problem, like using the GH syntax for trees?

Updated the GH file, but is this truly the only option? I simply liked GH syntax method.

cull.gh (38.4 KB)

The YouTuber made the Data Tree explanation substantially harder, but isn’t that how most educational institutions operate, such as Harvard’s awful CS 101? YouTube vid has gone surprisingly viral. :shaking_face:

probably the reason is that by setting Revome Empty (Branches) = True, the output data tree might be very much different (smaller) from the input one

you can always select a component (or more than one) and go file → Create user object:

Data Tree Masterclass with David Rutten

lol