Hello,

I am trying to output the DXF and NC code for a drawing into text files but when I create the text files and try to save and output the DXF and NC code, it does not populate the files with the code. I have tried hardcoding file paths and they still will not populate the files with anything. Please let me know if there is something I am missing or have incorrect syntax. There is barely any information in the API Help Library for the Drawing.SaveDxfFile and Drawing.OutputNC so any information will be helpful. Thank you.

Dim drw as Drawing

Dim FSO

Dim A

Dim B

Function outputProgramButton()

Set drw = App.Activedrawing

App.SelectPost (settingsForm.postTextBox.Text)

Set FSO = CreateObject("Scripting.FileSystemObject")
Set A = FSO.CreateTextFile(settingsForm.ncTextBox.Text & "" & "testfile" & ".anc", True)
Set B = FSO.CreateTextFile(settingsForm.dxfTextBox.Text & "" & "testfile" & ".dxf", True)

drw.SaveDxfFile "C:\Users\Spencer\Desktop\testfile.dxf", True, 6

drw.OutputNC "C:\Users\Spencer\Desktop\testfile.anc", acamOutNcFILE, True

End Function