One question: Assuming that you somehow have the indices you want, how are you planning on making sure that the "boundarynodes-vector" has its components sorted in the correct "order" to get a nice plot?
anyway, if you are only interested in the boundary coordinates, then the following works for me:
In [10]: from dolfin import *
In [11]: mesh = UnitSquareMesh(3,3)
In [12]: bmesh = BoundaryMesh(mesh, "exterior", True)
In [13]: print bmesh.coordinates()
[[ 0. 0. ]
[ 0.33333333 0. ]
[ 0. 0.33333333]
[ 0.66666667 0. ]
[ 1. 0. ]
[ 1. 0.33333333]
[ 0. 0.66666667]
[ 1. 0.66666667]
[ 0. 1. ]
[ 0.33333333 1. ]
[ 0.66666667 1. ]
[ 1. 1. ]]
If you are interested in plotting boundary data, then you may want to look at this.
Here is a minimal code. You'd have to view the output with paraview, however.
from dolfin import *
mesh = UnitSquareMesh(3,3)
bmesh = BoundaryMesh(mesh, "exterior", True)
V = FunctionSpace(mesh, "Lagrange", 1)
Vb = FunctionSpace(bmesh, "Lagrange", 1)
u = Function(V)
ub = interpolate(u,Vb)
File("./test_u.pvd") << u
File("./test_ub.pvd") << ub