This commit is contained in:
2026-03-08 15:49:41 +08:00
parent 22496d2b5e
commit 9a6585b72e
2 changed files with 20 additions and 13 deletions
+3 -2
View File
@@ -52,7 +52,7 @@ def verify_with_freecad(stp_path):
# 方法1: Import.insert (FreeCAD 0.21+)
try:
Import.insert(stp_path)
Import.insert(stp_path, doc.Name)
imported = True
print("使用 Import.insert 导入成功")
except Exception as e1:
@@ -63,6 +63,7 @@ def verify_with_freecad(stp_path):
try:
Import.open(stp_path)
imported = True
doc = FreeCAD.ActiveDocument
print("使用 Import.open 导入成功")
except Exception as e2:
print(f"Import.open 失败: {e2}")
@@ -81,7 +82,7 @@ def verify_with_freecad(stp_path):
# 方法4: Part.insert (旧版本)
if not imported:
try:
Part.insert(stp_path)
Part.insert(stp_path, doc.Name)
imported = True
print("使用 Part.insert 导入成功")
except Exception as e4: