I am trying to store the grid scale, but keep getting an error for being in the text editor view.
I have tried
bpy.context.area.type = "VIEW_3D"
print(bpy.context.space_data.grid_scale)
but am getting an attribute error for "SpaceTextEditor" not having a "grid_scale". However, the space does change to the 3d view, so the first line is going through.
Any help is appreciated.