# Get Point Coordinates generated with Geometry Nodes?

Say you generate some random points using Geometry Nodes, how can you get all those point coordinates using the python api?

The only hint I have is that the point coords are located under Point Cloud in the Spreadsheet Editor.

Basically, I want to use those coordinates for scripting other stuff I can't do with Geometry Nodes yet.

This is a workaround and I hope there is (or will eventually be) an easier way to access point cloud data in the API.

Instead of instancing points, create a new object, eg. a cube, go into edit mode, select everything and right click > Merge Vertices > At Center. That way you have an object with a single vertex at world origin.

In theory we should be able to access the vertices' geometry but for now the geometry is not "real". We need to trick the modifier into creating real geometry. There are multiple nodes for which it will work. I plugged a default and blank Attribute Math node before the modifier output.

Then, we need to access the evaluated mesh, after the GN modifier has been applied. For that we can use the context dependency graph.

import bpy

depsgraph = bpy.context.evaluated_depsgraph_get()
obj = bpy.context.active_object.evaluated_get(depsgraph)

print([v.co for v in obj.data.vertices])


Result :

• i love workaround if they work!! Great job! Jun 10, 2021 at 7:18
• Yeah, hopefully they simplify this so vertex instancing isn't needed, but for now it works so thank you! Jun 10, 2021 at 14:41