建立方向盘项目初始版本
This commit is contained in:
17
scripts/fix_washer_two_panel_gui.FCMacro
Normal file
17
scripts/fix_washer_two_panel_gui.FCMacro
Normal file
@@ -0,0 +1,17 @@
|
||||
from pathlib import Path
|
||||
import FreeCAD as A, FreeCADGui as G
|
||||
import os,traceback
|
||||
p=Path(r'C:\projects\wheel\models\washer_two_panels')
|
||||
try:
|
||||
for name in ['一体垫片板_0.5mm.FCStd','一体垫片板_1mm.FCStd']:
|
||||
d=A.openDocument(str(p/name));d.recompute()
|
||||
for o in d.Objects:
|
||||
if hasattr(o,'ViewObject') and o.ViewObject:o.ViewObject.Visibility=False
|
||||
d.getObject('Panel').ViewObject.Visibility=True
|
||||
G.activeDocument().activeView().viewAxonometric();G.activeDocument().activeView().fitAll()
|
||||
d.recompute();d.save();A.closeDocument(d.Name)
|
||||
(p/'gui_ready.txt').write_text('ok',encoding='utf8')
|
||||
os._exit(0)
|
||||
except Exception:
|
||||
(p/'gui_error.txt').write_text(traceback.format_exc(),encoding='utf8')
|
||||
os._exit(1)
|
||||
Reference in New Issue
Block a user