In blender 5.0 beta there is the new array modifier. ( in the background it is actually a "geometry node group" )
The modifier can be added and updated via python with:
bpy.ops.object.modifier_add_node_group(asset_library_type='ESSENTIALS',
asset_library_identifier="",
relative_asset_identifier="nodes/geometry_nodes_essentials.blend/NodeTree/Array",
use_selected_objects=False)
bpy.context.object.modifiers["Array"]["Socket_5"] = 6 # set the count
bpy.context.object.modifiers["Array"].node_group.interface_update(bpy.context) # update UI and 3D Viewer
Does anyone know how to create this NodesModifier without using bpy.ops ?
Thanks