Here's a little script that should do it.
import adsk.core, adsk.fusion, adsk.cam, traceback
def run(context):
app = adsk.core.Application.get()
ui = app.userInterface
try:
# Get the design from the active document.
doc = app.activeDocument
des: adsk.fusion.Design = doc.products.itemByProductType('DesignProductType')
cam: adsk.cam.CAM = doc.products.itemByProductType('CAMProductType')
# Get the first setup in Manufacturing.
setup = cam.setups[0]
# Get the parameter for the program comment.
param = setup.parameters.itemByName('job_programComment')
# Change the value to the same name as the document.
stringVal: adsk.cam.StringParameterValue = param.value
stringVal.value = doc.name
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com