def METHOD_NAME(filename):
    "called when freecad opens a file."
    Path.Log.track(filename)
    docname = os.path.splitext(os.path.basename(filename))[0]
    doc = FreeCAD.newDocument(docname)
    insert(filename, doc.Name)