The python tooltip says to use

bpy.data.screens["Scripting"].overlay.grid_scale = n

but that doesn't work. There are no other commands that execute when I do it manually. So it's just that command. Except when I do it programmatically it doesn't work (AttributeError: 'Screen' object has no attribute 'overlay'). This pictures sums up the problem.

enter image description here


1 Answer 1


The error message is trying to inform you that the property lookup <screen>.overlay was unsuccessful, because that's not where that property is located (the tooltip is misleading..) . It's something you might want to iterate through screen area.spaces to locate and set. It's a little awkward, but acceptable.

import bpy


for window in bpy.context.window_manager.windows:
    for area in window.screen.areas:
        if not area.type == AREA:

        for s in area.spaces:
            if s.type == AREA:
                s.overlay.grid_scale = 2


import bpy
for area in bpy.data.screens["Scripting"].areas:
    if area.type == 'VIEW_3D':
        for space in area.spaces:
            if space.type == 'VIEW_3D':
                space.overlay.grid_scale = 2
  • $\begingroup$ NICE! Thank you. $\endgroup$
    – user875234
    Commented Oct 6, 2019 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .