blender 2.8 how duplicate view3d area into new window from script
The operator still works in 2.80, but you need two parameters:


A custom context that tells the operator what area should be used for the new window
The correct execution context


The custom context can be created by modifying a copy of the current one. The area object for the 3D view can be found by iterating through bpy.context.screen.areas and checking for the type to be 'VIEW_3D'.

Executing bpy.ops.screen.area_dupli(context) will not work properly, because EXEC_DEFAULT is used as the default execution context. When this is the case event-&gt;customdata is NULL (see screen_ops.c) which results in the operator returning PASS_THROUGH and no window being created. The solution is to add INVOKE_DEFAULT as argument, which is exactly what the button in the user interface does.

import bpy

context = bpy.context.copy()

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        context['area'] = area
        bpy.ops.screen.area_dupli(context, 'INVOKE_DEFAULT')
        break