I use this
set_dihedral atom1_name, atom2_name, atom3_name, atom4_name, angle
for example
set_dihedral 22/C, 23/C, 26/C, 27/C, 130
So I want to change dihedral bonds this atoms
But when I wrote:
set_dihedral 23/CA, 23/C, 24/N, 24/CH3, 130
I had
SetDihedral-Error: Selection 1 doesn't contain a single atom/vertex.
SetDihedral-Error: Selection 2 doesn't contain a single atom/vertex.
SetDihedral-Error: Selection 3 doesn't contain a single atom/vertex.
SetDihedral-Error: Selection 4 doesn't contain a single atom/vertex.
Are you sure, your 3D file doesn't contain more than one structure with the same names of the atoms you select? You could post your .cif file here. Or maybe you have to use a different selection syntax (e.g. "name" C23, etc. see below).
If I use the structure of stearic acid for example, this works flawlessly:
enter dihedral angle in PyMOL with a selection of four atoms