From: Monika Madhavi (monikamadhavi_at_gmail.com)
Date: Fri Mar 06 2015 - 08:04:17 CST

Thanks Ashar. Yes what you have said is correct. It should be

proc trace {N seltext} {

set sel [atomselect top "$seltest"]
..................
}

should save it as trace.tcl and call it as
source trace.tcl
trace 5 all

Monika

On Fri, Mar 6, 2015 at 2:52 PM, Ashar Malik <asharjm_at_gmail.com> wrote:

> You need to make the selection outside the procedure and pass it like you
> are doing N.
>
> To see this after you set the sel to all, use the puts command to display
> the contents of sel. It should say atomselect followed by something ... If
> that's not showing up then you are not getting the selection right .... The
> error just means that $sel has no selection.
>
> Hope this helps.
> On Mar 6, 2015 10:12 PM, "Monika Madhavi" <monikamadhavi_at_gmail.com> wrote:
>
>> Dear all
>>
>> I want to select all the atoms in my simulation box and select some N
>> number of atoms from it. I want to select the atoms from my trajectory,
>> mytraj.dcd file. I wrote a tcl script "trace.tcl" which contains a
>> procedure called "trace" which takes N as the argument.
>>
>> This is the structure of trace.tcl
>>
>> proc trace {N} {
>>
>> set sel [atomselect top all]
>> set dim [measure minmax $sel]
>> .......................
>> some more steps..............
>> }
>>
>> in vmd I loaded my .dcd file and .psf file and then in Tkconsole I typed
>> source trace.tcl
>> trace 10
>>
>> this gives me an error "measure minmax: no atom selection"
>>
>> I cannot understand why I get this error and how to stop that. I am very
>> grateful to anyone who can help.
>>
>> Thank you.
>> Regards,
>> Monika
>> --
>> W.A.Monika Madhavi
>> Lecturer (Probation),
>> Department of Physics,
>> University of Colombo.
>>
>

-- 
W.A.Monika Madhavi
Lecturer (Probation),
Department of Physics,
University of Colombo.