Choice item from list

Hi all

in the expression component, how can I indicate/recall an item from the point list in this case

ex: I would only need the cv0 or cv1 or cv2 or add them as in the photo?


edit:
as long as the expression component handles lists. . .

perhaps the only way is programming. . .

No, it’s not the only way. Standard GH components like List Item will give you specific points. It depends on context?

3. Attach minimal versions of all the relevant files

You joined this forum seven years ago and ask this question now? :man_facepalming:

2 Likes

you’re right, I joined this forum 7 years ago and I don’t consider myself an expert, but in these 7 years, in my own small way I have pointed out and suggested to people much more expert than me details that they themselves were not aware of. so if you believe that only years of experience can make the difference, I personally believe that you can be the most expert in the world in anything you want, but on this belief I can endorse “you are really off track” what has been said so far now it was right to clarify my thoughts since you opened the parenthesis of 7 years.

returning to the question in my post, apparently either I wasn’t clear enough or you didn’t understand the question, what I would like to achieve directly within the expression component is what I was able to do with the Python component by setting input cv as List Access which would be this:
a=cv[0] in the case of the first point
or
a=cv[1] in the case of the second point
or
a=cv[2] in the case of the third point

I don’t know if it’s possible to do it and how, but from the solution you
posted using the List Item I can deduce that the answer is negative.

ah just by the way, in my personal opinion if you answer a question in a post in a forum created precisely for this purpose, I believe that the priority is to give a constructive answer, without underlining “even if that were the case” the shortcomings of the person who opened the discussion.

greetings and thanks for the reply, see you next time.

On the contrary, I believe people should search for answers before creating a thread five minutes after joining this forum - which happens all the time.

But I am surprised to hear this question from someone who has been here seven years,.

and I am incredulous that after the initial question with photos, subsequently having posted the solution always with photos for the intent I wanted to obtain and again after the last nice full-bodied explanation given in the last post, it is still not clear to you that at that result I intend to get there without adding other inputs to the Expression component, so the solution you keep proposing to me is the way I don’t want to approach the problem but I intend to have the same result having only one input in the Expression component but being able to manage n elements as I published with the Python component.

purpose: since the input of n points is unknown, I don’t like that every time the item list changes I have to add/remove input to the Expression component, the same thing I would have to do to the List Item component. while I simply mean to change the expression l inside the same which in this case is identified as the solution in the Python component, so if you find a way to do the same thing using the Expression component then hats off :mortar_board:

ps just to clarify, the sum of the points I posted is just an example to make it clear that in this way I can manage the individual points with a single input, you know how this discussion started, I wouldn’t be surprised if it is presented to me as solution the Addition component

Mass Addition component :question:

-Kevin

1 Like

no no @kev.r

I need to be able to manipulate the input values as desired, see attached photo, do sums between the points, extrapolate the individual coordinates, etc.

I tried combining the text of all the elements in a single line, but then I didn’t find a way to split into substrings using a separator, maybe if the split was feasible you could think of doing it

ps provided that the data can be managed not as text obviously. but I don’t think it’s feasible,
I’m convincing myself that using the Python component is the only solution for this.

By all means, use Python if you want but I seriously doubt that it’s “the only solution for this”. Looks like you have an aversion to using GH components?

not at all, I just find that in this specific case Python is much more practical, that’s all.

You aren’t posting GH code or geometry so hard to compare. Just this, eh?


points_sum_2024Feb25a.gh (9.2 KB)

you won :clap:

Not interested in winning so much as knowing what’s possible with standard GH components vs. code.


points_sum_2024Feb25b.gh (10.5 KB)

I advise you to delve deeper into the codes and especially the libraries that can be imported into Python, given that everything you do in Gh with all its components by connecting them together is easily done by writing codes even using a single Python component.

I don’t need your advice, thanks anyway. I’ve been programming my entire adult life, longer than you might realize, and enjoy GH components more than language syntax now. Not that I’m averse to a bit of Python now and then, but only when there are clear advantages, which is rarely.

1 Like

so the fact that you aim to use Gh components is due to your personal preference, that’s fine, I respect that, but this doesn’t make it an objective fact that one method is better than the other. I’m glad you’ve been programming for a long time, so you should know that in Python you can replicate all the actions of the standard components used in Gh, so we return to the point that the choice between using components or writing code is only a pure personal choice and not an objective advantage of the facts.

I believe that this 3d can be considered closed, since already after my second post, the other answers have not brought any profitable contribution both to the solution posed in question and to the entire forum community.

:rofl: The objective fact is that Python code is not “the only solution for this”.

:man_facepalming: :man_facepalming: