import FreeCAD

doc = FreeCAD.open("STM-Frame.FCStd")
magnets = doc.findObjects(Label="Magnet.*")
for m in magnets:
    if m.TypeId != "App::Link":
        continue
    pos = m.Placement.Base
    print(f"{pos.x:.5f}, {pos.y:.5f}, {pos.z:.5f}")
