Files
freecad-robust-mcp-fc111/_patch_fix.py
T
petemar 29f63d19c7
CodeQL Analysis / Analyze (python) (push) Has been cancelled
Pre-commit Checks / Run Pre-commit Hooks (push) Has been cancelled
Docker Build / Build Docker Image (push) Failing after 2m27s
Tests / Python Tests (push) Has been cancelled
Deploy Documentation / deploy (push) Waiting to run
FC 1.1.1 fixes: AttachmentSupport via PropertiesList, import Sketcher, Midplane fallback
2026-07-09 19:13:56 +02:00

21 lines
994 B
Python

with open("src/freecad_mcp/tools/partdesign.py", "r") as f:
c = f.read()
# Revolution fix
old1 = "rev.Symmetric = {symmetric}\nrev.Reversed = {reversed}"
new1 = "# FC 1.1.1: use Midplane instead of Symmetric\nif \"Midplane\" in rev.PropertiesList:\n rev.Midplane = {symmetric}\nelif \"Symmetric\" in rev.PropertiesList:\n rev.Symmetric = {symmetric}\nrev.Reversed = {reversed}"
c = c.replace(old1, new1)
print(f"Revolution: {'fixed' if old1 in c else 'may have issues'}")
# Groove fix
old2 = "groove.Symmetric = {symmetric}\ngroove.Reversed = {reversed}"
new2 = "# FC 1.1.1: use Midplane instead of Symmetric\nif \"Midplane\" in groove.PropertiesList:\n groove.Midplane = {symmetric}\nelif \"Symmetric\" in groove.PropertiesList:\n groove.Symmetric = {symmetric}\ngroove.Reversed = {reversed}"
c = c.replace(old2, new2)
print(f"Groove: {'fixed' if old2 in c else 'may have issues'}")
with open("src/freecad_mcp/tools/partdesign.py", "w") as f:
f.write(c)
print("Done")