计算化学公社

标题: 求助:VMD中使用脚本突然出现atomselect语法问题, cannot parse selection text [打印本页]

作者
Author:
GuoBa2011    时间: 2021-5-21 17:10
标题: 求助:VMD中使用脚本突然出现atomselect语法问题, cannot parse selection text
使用的脚本为:
proc showtrj {fps1 fps2 space selection} {
set selnow [atomselect top $selection frame $fps1]
set selnext [atomselect top $selection frame $fps1]
set num [$selnow num]
for {set fps $fps1} {$fps<$fps2} {incr fps $space} {
$selnow frame $fps
$selnext frame [expr $fps+$space]
$selnow update
$selnext update
for {set i 0} {$i<$num} {incr i 1} {
draw line [lindex [$selnow get {x y z}] $i] [lindex [$selnext get {x y z}] $i]
draw sphere [lindex [$selnext get {x y z}] $i] radius 0.12
}
puts "Frame $fps done"
}}

该脚本可以显示粒子运动轨迹,使用的命令是showtrj 0 -1 1 "index49" 以及showtrj 0 -1 1 index49,前两天还能用,更换另外结构后现显示atomselect: cannot parse selection text: index49,请问该如何解决

作者
Author:
GuoBa2011    时间: 2021-5-21 17:13
selection中显示是有index,序号也有
作者
Author:
sobereva    时间: 2021-5-21 17:18
GuoBa2011 发表于 2021-5-21 17:13
selection中显示是有index,序号也有

有别人回复之前若需要对帖子进行修改、补充,应直接编辑原帖,不要通过回帖进行补充,这点在置顶的新社员必读贴里明确说了
作者
Author:
sobereva    时间: 2021-5-21 17:19
index49显然得写成index 49

VMD里原子选择语句的语法和例子
http://sobereva.com/504http://bbs.keinsci.com/thread-14267-1-1.html

作者
Author:
GuoBa2011    时间: 2021-5-21 17:44
sobereva 发表于 2021-5-21 17:18
有别人回复之前若需要对帖子进行修改、补充,应直接编辑原帖,不要通过回帖进行补充,这点在置顶的新社员 ...

感谢提醒,初次发帖没注意该项要求,下次不会再犯了。
作者
Author:
GuoBa2011    时间: 2021-5-21 17:45
sobereva 发表于 2021-5-21 17:19
index49显然得写成index 49

VMD里原子选择语句的语法和例子

感谢sob老师解答,问题顺利解决!




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3