How to select and separate same vertices as current selection on copied, very similar geometry My main goal is to separate multiple geometries the same way by vertice selection. All the objects differ only a little bit in their vertice position, because they only are deformed by already applied shape keys originating from the same origin object (amount and distribution of vertices are the same).
My current strategy (corresponding to the bpy script below): Starting with a selection of vertices on the initial geometry, I would like to additionally import multiple very similar ones. By saving the vertice selection, the separation should be applied one object after another. (edited)

Please see my code below. Since it did not work to directly compare vertice objects, that initially have been stored to a list (previous version), I now try to compare list indexes.

Unfortunately, my example code only separates one object in the two geometrical parts:

import bpy
import os, glob

# script to separate same edit mode selection on multiple imported .fbx files in directory

class Import(object):
    def __init__(self):
        pass

    @staticmethod
    def import_fbxfiles_from_dir(path = "C:\\Users\\user\\Desktop\\test_parts\\"):
        os.chdir(path)
        for fbx in [f for f in os.listdir(path) if f.endswith(".fbx")]:
            print ("imported file: " + fbx)
            bpy.ops.import_scene.fbx(filepath=fbx, filter_glob=".fbx;", axis_forward="-Z", axis_up="Y")

class Separate_test(object):
    def __init__(self):
        pass

    def separate_initially_selected_verts(self):
        obj = bpy.context.scene.objects.active  # active object
        mesh = obj.data
        self.selected_vert_list_IDs = [key for key,v in enumerate(mesh.vertices) if v.select]
        print("selected verts:", self.selected_vert_list_IDs)

        bpy.ops.object.mode_set(mode='OBJECT')  # exit edit mode

        obNr = 0
        for ob in bpy.context.scene.objects:
            if ob.type == 'MESH':
                print("-- Object:", obNr, "/", len(bpy.context.scene.objects))
                bpy.context.scene.objects.active = ob

                # set to edit mode
                bpy.ops.object.mode_set(mode='EDIT')

                # select verts from list
                count_select = 1
                for key_ob,v in enumerate(bpy.context.scene.objects.active.data.vertices):
                    if key_ob in self.selected_vert_list_IDs:
                        count_select += 1
                        # print("vertices separated in obj: {0} of {1}".format(count_select, len(self.selected_vert_list_IDs)))
                        v.select = True

                bpy.ops.mesh.separate(type='SELECTED')
                bpy.ops.object.mode_set(mode='OBJECT')  # exit edit mode
            obNr += 1


if __name__ == "__main__":
    Import.import_fbxfiles_from_dir()
    separate_obj = Separate_test()

    separate_obj.separate_initially_selected_verts()
    input("press return to quit.")
Perfect candidate for bmesh

Script to run in edit or object mode with "basis" mesh selected.

For each mesh object having same amount of vertices add a split by selection object.  Selection: Default 'SELECT' uses selected vertices in basis. 'LOC' tags all verts within a tolerance of basis.

Set this up as a class such that it can be instanced with the basis object, and called with another.

import bpy
import bmesh


class diff:
    def split(self, scene, ob, select='SELECT'):
        me = ob.data
        bm = bmesh.new()
        bm.from_mesh(me)
        if select == 'SELECT':
            select = self.tag_select(bm)        
        elif select == 'LOCATION':
            select = self.tag_same_loc(bm)
        else:
            print("Error.. not in SELECT, LOCATION")
            select = False

        if select:
            obcopy = ob.copy()
            me = me.copy()
            # remove selected from one
            bmesh.ops.delete(bm, geom=[v for v in bm.verts if not v.tag], context=1)
            bm.to_mesh(me)
            obcopy.data = me
            scene.objects.link(obcopy)

    def tag_select(self, bm):
        for v0, v in zip(self.bm.verts, bm.verts):
            v.tag = v0.select
        return any(v.tag for v in bm.verts)

    def tag_same_loc(self, bm, TOL=1.0e-3):
        for v0, v in zip(self.bm.verts, bm.verts):
            v.tag = (v.co - v0.co).length &lt; TOL
        return any(v.tag for v in bm.verts)        

    def __init__(self, scene, ob):
        me = ob.data
        if ob.mode == 'EDIT':
            bm = bmesh.from_edit_mesh(me)
        else:
            bm = bmesh.new()
            bm.from_mesh(me)
        self.bm = bm

if __name__ == "__main__":        
    context = bpy.context
    scene = context.scene
    ob = context.object
    d = diff(scene, ob)
    shapes = [o for o in scene.objects
                if o.type == 'MESH'
                and len(o.data.vertices) == len(o.data.vertices)]
    shapes.remove(ob) 

    for s in shapes:
        d.split(scene, s)