From: Ana Celia Vila Verde (acavilaverde_at_gmail.com)
Date: Tue May 08 2012 - 09:31:23 CDT

Hi Erik,

To get the number of atoms of type Csp3 you can do:

# select the atoms you want
set sel [atomselect top "type Csp3"]

# have a look at
http://www.ks.uiuc.edu/Research/vmd/vmd-1.8.3/ug/node107.html for the
explanation of the command
set numAtoms [$sel num]
puts " the number of Csp3 atoms is $numAtoms"

# you should always delete selections to save memory
$sel delete

Cheers!

Ana

On 5/8/12 3:37 PM, winardi, erik wrote:
> Hi VMD users,
>
> Is there any command to count a specific atom types ?
> For example if the system has two types of C (Csp3 as type 1 and Csp2
> as type 2)
> How can I count the number of atom for each type carbon ?
>
> Thanks,
> Erik Winardi