Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | Letzte ÜberarbeitungBeide Seiten der Revision | ||
projekte:autodesk_fusion [2020/02/07 19:39] – [Open active product in Slic3r] admin | projekte:autodesk_fusion [2020/04/28 14:32] – [Open active product in Slic3r] admin | ||
---|---|---|---|
Zeile 24: | Zeile 24: | ||
app = adsk.core.Application.get() | app = adsk.core.Application.get() | ||
ui = app.userInterface | ui = app.userInterface | ||
- | # | ||
f = tempfile.NamedTemporaryFile(delete=False) | f = tempfile.NamedTemporaryFile(delete=False) | ||
f.close() | f.close() | ||
Zeile 35: | Zeile 34: | ||
t = threading.Thread(target=startAndWait, | t = threading.Thread(target=startAndWait, | ||
t.start() | t.start() | ||
- | | + | |
except: | except: | ||
if ui: | if ui: | ||
Zeile 44: | Zeile 43: | ||
ui = app.userInterface | ui = app.userInterface | ||
rv = [] | rv = [] | ||
- | | + | |
- | product = app.activeProduct | + | product = app.activeProduct |
- | design = adsk.fusion.Design.cast(product) | + | design = adsk.fusion.Design.cast(product) |
- | exportMgr = design.exportManager | + | exportMgr = design.exportManager |
- | + | ||
- | i = 0 | + | i=0 |
- | for comp in design.allComponents: | + | for comp in design.allComponents: |
- | for body in comp.bRepBodies: | + | #for body in comp.bRepBodies: |
- | fileName = " | + | fileName = " |
- | # create stl exportOptions | + | # |
- | stlExportOptions = exportMgr.createSTLExportOptions(body, fileName) | + | # |
- | stlExportOptions.sendToPrintUtility = False | + | |
- | stlExportOptions.meshRefinement = adsk.fusion.MeshRefinementSettings.MeshRefinementHigh | + | try: |
+ | | ||
+ | stlExportOptions = exportMgr.createSTLExportOptions(comp, fileName) | ||
+ | stlExportOptions.sendToPrintUtility = False | ||
+ | stlExportOptions.meshRefinement = adsk.fusion.MeshRefinementSettings.MeshRefinementHigh | ||
+ | exportMgr.execute(stlExportOptions) | ||
+ | rv.append(fileName) | ||
+ | i+=1 | ||
+ | except: | ||
+ | if ui: | ||
+ | ui.messageBox(' | ||
| | ||
- | exportMgr.execute(stlExportOptions) | ||
- | i+=1 | ||
- | rv.append(fileName) | ||
- | except: | ||
- | if ui: | ||
- | ui.messageBox(' | ||
return rv | return rv | ||
</ | </ | ||