original_docstring: 
      Itterate through each body withing the corrent occurence (Fusions object name for component)
      Exporting files as STLs based on parameters stored in the context object ctx
      
docstring: Itterate through each body withing the corrent occurence (Fusions object name for component)
  Exporting files as STLs based on parameters stored in the context object ctx
docstring_tokens: Itterate through each body withing the corrent occurence ( Fusions object name for component ) Exporting files as STLs based on parameters stored in the context object ctx
code: def process_bodies(ctx, bodies, parent_name, exportManager):
      '''
      Itterate through each body withing the corrent occurence (Fusions object name for component)
      Exporting files as STLs based on parameters stored in the context object ctx
      '''
      body_count = 0
      for body in bodies:
          body_count += 1
          
  
          if not body.isLightBulbOn and ctx.ignore_hidden_bodies:
              # Skip this body
              continue
  
          body_name = body.name
          
          # Check if name is default
          if re.match(r'Body\d+$',body_name):
              if ctx.rename_default_bodies:
                  if len(bodies) == 1:
                      body_name = parent_name
                  else:
                      body_name= f"{parent_name}_{body_count}"
          
          # There is a risk of overwrite here if there is duplicated component names
          if ctx.set_bodies_to_component_name:
              if len(bodies) == 1:
                  body_name = parent_name[:-2]
              else:
                  body_name= f"{parent_name[:-2]}_{body_count}"           
          
          body_name = sanitize_filename(body_name)
          body_name = f"{ctx.prefix}{body_name}{ctx.suffix}.stl"
  
          export_path = os.path.join(ctx.folder, body_name)
          if os.path.exists(export_path):
              if ctx.do_not_overwrite_outputs:
                  continue
          
          export_job = exportManager.createSTLExportOptions(body, export_path)
          exportManager.execute(export_job)
code_tokens: def process_bodies ( ctx , bodies , parent_name , exportManager ) : body_count = 0 for body in bodies : body_count += 1 if not body . isLightBulbOn and ctx . ignore_hidden_bodies : continue body_name = body . name if re . match ( r'Body\d+$' , body_name ) : if ctx . rename_default_bodies : if len ( bodies ) == 1 : body_name = parent_name else : body_name = f"{parent_name}_{body_count}" if ctx . set_bodies_to_component_name : if len ( bodies ) == 1 : body_name = parent_name [ : - 2 ] else : body_name = f"{parent_name[:-2]}_{body_count}" body_name = sanitize_filename ( body_name ) body_name = f"{ctx.prefix}{body_name}{ctx.suffix}.stl" export_path = os . path . join ( ctx . folder , body_name ) if os . path . exists ( export_path ) : if ctx . do_not_overwrite_outputs : continue export_job = exportManager . createSTLExportOptions ( body , export_path ) exportManager . execute ( export_job )
short_docstring: Itterate through each body withing the corrent occurence (Fusions object name for component)
  Exporting files as STLs based on parameters stored in the context object ctx
short_docstring_tokens: Itterate through each body withing the corrent occurence ( Fusions object name for component ) Exporting files as STLs based on parameters stored in the context object ctx
comment: '''
      Itterate through each body withing the corrent occurence (Fusions object name for component)
      Exporting files as STLs based on parameters stored in the context object ctx
      '''$SEP$# Skip this body$SEP$# Check if name is default$SEP$# There is a risk of overwrite here if there is duplicated component names