Scripting the generation of a curve from the set of mesh centers drawn using BTrace add-on
The operator that you're trying to call "bpy.ops.object.btobjectsconnect()" is part of the bTrace addon and not in Blender by default. It's defined in the plugin file btrace.py. You can find the code that built that operator around line 534 here: https://github.com/scottjwood/bTrace/blob/master/bTrace.py