I think I'm making a little progress. CAMPart has a field called OutFile that seems to have some effect, sometimes.
After setting this property I'm still being prompted for a filename, and the proposed filename is not what is in the OutFile property.
Here is my latest attempt:
from CamBam.CAM import *
from CamBam.UI import CamBamUI
view = CamBamUI.MainUI.ActiveView
doc = view.CADFile
folder = "C:\\CamBamTemp"
for part in doc.Parts:
part.OutFile = "{0}\\{1}.nc".format(folder, part.Name)
print part.OutFile
#view.DrawingTree.ReloadTree() # doesn't fix
CAMUtils.GenerateGCodeOutput(view, part, None) # how to avoid prompt here
while view.CurrentEditMode is not None: app.Sleep(1) #wait
Actually, the more I test, it appears that the OutFile field does nothing. Even if you use the CamBam UI, click on the three-dot button, and enter a filename, the interactive "Produce gcode" command seems to ignore it.
If anyone uses "Out File", even in the interactive UI, could you tell us what it does?
Thx,
Bill