hexagon logo

Printing reports with serial # as file name.

I output a PDF report for every part I check and I currently use auto indexing to name them. There is a report comment at the beginning of the program that asks for the serial # of the part. I was wondering if it's possible to instead have PC DMIS automatically add that same serial # to the end of the file name instead of the index #. This would be helpful if I need to find the report for a specific piece later. I know I could just manually type it in each time. I'm just looking for a more efficient method since the serial #'s are often over 20 characters and I never remember what it was at the end of the program and I'd rather not take it off the machine before viewing the report in case I need to remeasure something. Am I asking too much here?
Parents
  • If you put the following in a bas module and call it with the argument for the new serial number, it will replace it in the header of the program and the report.

    Sub Main(SN As String)
    On Error GoTo err_Hand:
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    Part.serialnumber = SN
    Part.refreshpart
    
    Dim RepWindow As Object
    Set RepWindow = Part.reportwindow
    RepWindow.refreshreport
    
    Exit Sub
    err_Hand:
    MsgBox err.number
    MsgBox err.description
    Exit Sub
    End Sub
Reply
  • If you put the following in a bas module and call it with the argument for the new serial number, it will replace it in the header of the program and the report.

    Sub Main(SN As String)
    On Error GoTo err_Hand:
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    Part.serialnumber = SN
    Part.refreshpart
    
    Dim RepWindow As Object
    Set RepWindow = Part.reportwindow
    RepWindow.refreshreport
    
    Exit Sub
    err_Hand:
    MsgBox err.number
    MsgBox err.description
    Exit Sub
    End Sub
Children
No Data