From: Jérôme Hénin (jerome.henin_at_ibpc.fr)
Date: Fri Sep 06 2019 - 08:20:21 CDT

I see. The problem is likely that your list sorted_u2 is too short or
otherwise doesn't have the right format, so that $pcnt is empty. That's
when atomelect complains.

By the way, it seems $pcnt does not depend on the loop iteration, it could
be assigned before the loop. Or maybe you are not doing what you intended
to do... If you do want to set the beta property of all atoms to the same
value, then you could use a single selection and a single "set beta"
statement.

Jerome

On Fri, 6 Sep 2019 at 14:24, Alex Hummels <alexhummels_at_me.com> wrote:

> Ok. This is the actual code that produced the error. I cut out the things
> after the puts $nshell statement because I presumed if I didn’t see an
> output of 31 it meant it must have failed before that line. But I guess
> that’s not necessarily the case
>
> foreach nshell $valid_shells {
> puts $nshell
> set idx [expr $nshell - 1]
> set shell_i [lindex $shells $idx]
> foreach index $shell_i {
> set atom [atomselect top “index $index”]
> set pcnt [lindex [lindex $sorted_u2 $idx] 2]
> $atom set beta $pcnt
> }
> }
>
> Thanks,
> Alex
>
> On Sep 6, 2019, at 4:34 AM, Jérôme Hénin <jerome.henin_at_ibpc.fr> wrote:
>
> Hi,
>
> this code would not print that error. Please show the code up to the
> offending atomselect statement, or we can't help.
>
> Jerome
>
> On Fri, 6 Sep 2019 at 00:03, Alex Hummels <alexhummels_at_me.com> wrote:
>
>> Hello all,
>>
>> I’m encountering a weird error with tcl. I have a list valid_shells. When
>> I use puts, I see that this list is
>>
>> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28
>> 30 31
>>
>> Now I have a for loop that iterates over this list and prints the value.
>> This works until I get to the very last component, where I get the error
>>
>> atomselect set: 0 data items doesn’t match 1 selected atoms.
>>
>> In my actual script there is more that happens after this put statement,
>> but none of it happens and the loop stops after this error. The loop I’m
>> using that gives me this error is below. I’ve tried changing the loop from
>> a foreach loop to a for loop, also below, but the error remains the same--000000000000d50f6a0591e24d27--