x
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user