hexagon logo

Cell expressions in the header.

I need help... What cell expression should I add to get JOB NUMBER and PART NUMBER?

Thank you!

Parents
  • We used a tracefield for the operator to fill in their name on the report. Sadly that was setup by my coworker and I have no idea how it was done. 

  • I also tried Trace Field and it looks great, Thank you  . Looks very professional. I save this as a SUB routine. I added it into other programs, everything is fine, the problem is that nothing appears in the header when I run the program. I am filling in the data in the Trace Field that I created in sub routine, but the header does not show it.
    If I add Trace Field separately to each program, everything is fine.

    I don't know, maybe I'm making a mistake. 

    I'll be playing with this later today.

  • If you do Tracefield, that data is preset, so it becomes a list of items. Does that work for what you want to do? I use Tracefields, but only for things like ArkansasBeeper said, operator. We use operator and part number, job number is always changing and can't be logged this way.

    If all your information is always the same, then I also would have suggested tracefield, and not manual inputs. Sorry about that.

  • There is 2 ways to go about this I can think off right now

    1. Inside the Tracefield window, set preset parameters of all possible Operator ID's/Operator Names
    
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Select Operator ID ; Operator Number : Operator
    
    2. Let them manually input the data which can cause user error such as typos. So you'd have to create 
    flow control statements to prevent this.
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Enter Operator Name
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Select Operator ID ; Operator Number : C1.INPUT
    

    Option 1 has the most control, and prevents any possible error, except for selecting the wrong name. This works well if you have a reliable work team. But does not work well with things that are always changing, like at my workplace. Job numbers are always different. This would not work well. So you'd need to do option 2, but not use any form of error detection except for maybe preventing too many digits or not letting a job number end in anything other than 0.

    Option 2 is a freeform input field that you'll have to control with IF, ELSE, CASE, SWITCH or any other type of flow control.

    As far as placing this information into your report, you can make a copy of the header label template, then modify the cell you wish to import the data into.

    Cell would be =TRACEFIELD(1) assuming this is your first tracefield you're pulling from, if it's the second tracefield, simply change it to =TRACEFIELD(2)

  • Thank you for quick response... I'm grateful for every idea!

    In my work, the data also changes often, but the advantage is that I am the only one who creates and runs CMM.

  • Oh that makes it a lot easier! If it's just you who runs the CMM, then all your information is readily available except for Job Numbers. I was thinking too big when I started helping. I'm glad you got it sorted.

    I don't think you truly need to even make subroutines, but it's always good to get things to work.

  • It's easier for now, and you know what, every idea is valuable because you don't know when you'll need it.

    Thanks!

  • Just for me, I find it easiest to include a script at the end of the program and pass it arguments for new values in the header. You can auto-increment, obtain them from operators, whatever works best. And that also avoids me having to change report and/or header formats.

    Sub Main(SN As String, PN As String, RN As String, SC As String)
      Dim App As Object
      Set App = CreateObject("PCDLRN.Application")
    
      Dim Part As Object
      Set Part = App.ActivePartProgram
      
      Part.PartName = PN
      Part.StatsCount = SC
      Part.SerialNumber = SN
      Part.RevisionNumber = RN
      
      Part.RefreshPart
    
      Part.Save
    
      Dim Rep As Object
      Set Rep = Part.ReportWindow
      Rep.RefreshReport
    End Sub

Reply
  • Just for me, I find it easiest to include a script at the end of the program and pass it arguments for new values in the header. You can auto-increment, obtain them from operators, whatever works best. And that also avoids me having to change report and/or header formats.

    Sub Main(SN As String, PN As String, RN As String, SC As String)
      Dim App As Object
      Set App = CreateObject("PCDLRN.Application")
    
      Dim Part As Object
      Set Part = App.ActivePartProgram
      
      Part.PartName = PN
      Part.StatsCount = SC
      Part.SerialNumber = SN
      Part.RevisionNumber = RN
      
      Part.RefreshPart
    
      Part.Save
    
      Dim Rep As Object
      Set Rep = Part.ReportWindow
      Rep.RefreshReport
    End Sub

Children
No Data