Here is a little snippet that prints out all the coordinates of the hair vertices from the first particle system on a selected object. Make sure the object has a hair particle system.
import bpy
object = bpy.context.object
hairs = object.particle_systems[0].particles
for i, h in enumerate(hairs):
print('hair number {i}:'.format(i=i))
for i, hv in enumerate(h.hair_keys):
print(' vertex {i} coordinates: {co}'.format(i=i, co=hv.co))
particle_systems[0]
is used to get to the first particle system of the object. After this the particles
are all the particles in the system (in this case the hairs). The hair vertices are accessed with hair_keys
. Finally to get the coordinates of a hair vertex you use co
.
If you want the coordinate of only one hair vertex, you could type it in one nasty line:
bpy.context.object.particle_systems[0].particles[0].hair_keys[0].co