daid / LegacyCura

Read this, it's important! NEW CURA DEVELOPMENT IS HAPPENING AT https://github.com/Ultimaker/Cura, this is the Cura 15.04 archive. Cura 2.1 and newer is on the Ultimaker github.
https://www.ultimaker.com/pages/our-software
585 stars 430 forks source link

Proposal: adding machine specific suffix to filename #871

Open Dim3nsioneer opened 10 years ago

Dim3nsioneer commented 10 years ago

As Cura allows for some time now to have multiple machines defined, I propose a machine specific suffix to be added to the filename optionally. Example: Model name is 'sphere.stl'. Today's filename generated would be 'sphere.gcode'. With the optional suffix, it would be e.g. 'sphere_UM2.gcode', 'sphere_UMO.gcode' or 'sphere_RepRap.gcode', depending on which machine it was sliced for.

weiin commented 9 years ago

I would like this as well. I'm using the following modification to replaceTagMatch in Cura/util/profile.py to get the machine_name tag.

Now you can use that in your start gcode eg: ;Sliced at: {day} {date} {time} for {machine_name}

def replaceTagMatch(m): pre = m.group(1) tag = m.group(2) if tag == 'time': return pre + time.strftime('%H:%M:%S') if tag == 'date': return pre + time.strftime('%d-%m-%Y') if tag == 'day': return pre + ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][int(time.strftime('%w'))] if tag == 'print_time': return pre + '#P_TIME#' if tag == 'filament_amount': return pre + '#F_AMNT#' if tag == 'filament_weight': return pre + '#F_WGHT#' if tag == 'filament_cost': return pre + '#F_COST#' if tag == 'profile_string': return pre + 'CURA_PROFILE_STRING:%s' % (getProfileString()) if pre == 'F' and tag == 'max_z_speed': f = getProfileSettingFloat('travel_speed') * 60 if pre == 'F' and tag in ['print_speed', 'retraction_speed', 'travel_speed', 'bottom_layer_speed', 'cool_min_feedrate']: f = getProfileSettingFloat(tag) * 60 elif isProfileSetting(tag): f = getProfileSettingFloat(tag) elif isPreference(tag): f = getProfileSettingFloat(tag) elif isMachineSetting(tag): return pre + getMachineSetting(tag) else: return '%s?%s?' % (pre, tag) if (f % 1) == 0: return pre + str(int(f)) return pre + str(f)