Skip to content

Commit

Permalink
end exporting of old_components
Browse files Browse the repository at this point in the history
added in a check for "old_component" and if seen skip exporting that component.
  • Loading branch information
alansrobotlab2 committed Jun 22, 2019
1 parent a11f09c commit eff23c9
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 @@ -71,22 +71,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 eff23c9

Please sign in to comment.