def METHOD_NAME(
    objectslist,
    filename
):
    "called when freecad exports an object to vtk"
    if len(objectslist) > 1:  # the case of no selected obj is caught by FreeCAD already
        Console.PrintError(
            "This exporter can only export one object at once\n"
        )
        return
    obj = objectslist[0]
    if obj.isDerivedFrom("Fem::FemPostPipeline"):
        Console.PrintError(
            "Export of a VTK post object to vtk is not yet implemented!\n"
        )
        return
    elif obj.isDerivedFrom("Fem::FemMeshObject"):
        Console.PrintError(
            "Use export to FEM mesh formats to export a FEM mesh object to vtk!\n"
        )
        return
    elif obj.isDerivedFrom("Fem::FemResultObject"):
        Fem.writeResult(filename, obj)
    else:
        Console.PrintError(
            "Selected object is not supported by export to VTK.\n"
        )
        return