I have a script that creates new camera and make it active but i cant override context for 'align camera to view'.
How to do it in blender 3.6?
import bpy
# Create a new camera
bpy.ops.object.camera_add()
# Get the newly created camera object
new_camera = bpy.context.object
# Set the new camera as the active camera
bpy.context.scene.camera = new_camera