Skip to content

Commit

Permalink
Merge pull request #20 from alansrobotlab/stop_exporting_old_components
Browse files Browse the repository at this point in the history
end exporting of old_components
  • Loading branch information
syuntoku14 authored Jul 14, 2019
2 parents f877e91 + eff23c9 commit dd1ae98
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions URDF_Exporter/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,21 @@ def export_stl(design, save_dir, components):
scriptDir = save_dir + '/mm_stl'
# export the occurrence one by one in the component to a specified file
for component in components:
if 'old' in component.name:
continue
allOccus = component.allOccurrences
for occ in allOccus:
try:
print(occ.component.name)
fileName = scriptDir + "/" + occ.component.name
# create stl exportOptions
stlExportOptions = exportMgr.createSTLExportOptions(occ, fileName)
stlExportOptions.sendToPrintUtility = False
stlExportOptions.isBinaryFormat = False
# options are .MeshRefinementLow .MeshRefinementMedium .MeshRefinementHigh
stlExportOptions.meshRefinement = adsk.fusion.MeshRefinementSettings.MeshRefinementMedium
exportMgr.execute(stlExportOptions)
except:
print('Component ' + occ.component.name + 'has something wrong.')
if 'old_component' not in occ.component.name:
try:
print(occ.component.name)
fileName = scriptDir + "/" + occ.component.name
# create stl exportOptions
stlExportOptions = exportMgr.createSTLExportOptions(occ, fileName)
stlExportOptions.sendToPrintUtility = False
stlExportOptions.isBinaryFormat = False
# options are .MeshRefinementLow .MeshRefinementMedium .MeshRefinementHigh
stlExportOptions.meshRefinement = adsk.fusion.MeshRefinementSettings.MeshRefinementLow
exportMgr.execute(stlExportOptions)
except:
print('Component ' + occ.component.name + 'has something wrong.')


def file_dialog(ui):
Expand Down

0 comments on commit dd1ae98

Please sign in to comment.