Pulling number of hits?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pulling number of hits?

    Good Morning Gang,
    I'm looking for a short and sweet way to get a total number of points taken in a program. Basically i'm getting push back on wearable items on the CMM from my bosses and the bean counters. If i can get a number of hits taken per program, i can give them a realistic breakdown of just how many beeps happen per shift, per day and why wearable items might be necessary more often than they think. Is there a GETPROGRAMINFO line that i could use? I havent found anything like this in other threads and even the mighty google machine has nill for suggestions.

  • #2
    You would have to assign the .NUMHITS value from every feature to a variable and add them up as you go. It sounds like your "bean counters" might be more interested in SFX asset management https://www.hexagonmi.com/en-GB/abou...mm-performance

    It's designed to monitor machine utilisation amongst other things and in conjunction with PULSE https://www.hexagonmi.com/products/c...cmms/mms-pulse can also monitor things like collisions, temperature fluctuation, air pressure, humidity etc.
    Neil Challinor
    PC-DMIS Product Owner

    T: +44 870 446 2667 (Hexagon UK office)
    E: [email protected]

    Comment


    • #3
      The code seems ito work for most features and also acconts for SAMPLE Hits.

      Feel free to use and improve it.

      (Typed in by hand, so hopefully no context misspellings)
      Code:
      Sub Main
      Dim PCDApp, PCDPartPrograms, PCDPartProgram,PCDCommands,PCDCommand, PCDFeatCmd
      Dim numhits, nhits, total_nhits, phits, total_phits, grand_total_hits,total_feature as Integer
      
      Set PCDApp = CreateObject("PCDLRN.Application")
      Set PCDPartPrograms = PCDApp.PartPrograms
      Set PCDPartProgram = PCDApp.ActivePartProgram
      Set PCDCommands = PCDPartProgram.Commands
      
      Dim FeatureList$(999999)
      Dim cmd as Object
      Dim Fcntr, fcntr2 as Integer
      
      Fcntr = 0
      Fcntr2 = 0
      Nhits = 0
      Phits = 0
      total_hits = 0
      Total_phits =0
      
      ' enumerate commands total in variable fcntr2
      For Each cmd in PCDCommands
      If cmd.IsMeasuredFeature or cmd.DCCFeature or cmd.IsScan or cmd.IsBasicScan Then
      Fcntr2 = Fcntr2 + 1
      End If
      Next cmd
      
      'enumerate NUMBER (Numhits) and SAMPLE (Permhits) in each command
      For Each cmd in PCDCommands
      If cmd.IsMeasuredFeature or cmd.DCCFeature or cmd.IsScan or cmd.IsBasicScan Then
      FeatureList(Fcntr) = cmd.id
      fname = FeatureList(Fcntr)
      Set PCDCommand = PCDCommands.Item(FeatureList(fcntr))
      Set PCDFeatCmd = PCDCommand.FeatureCommand
      Fcntr = fcntr +1
      
      nhits = PCDFeatCmd.numhits
      phits = PCDFeatCmd.Permhits
      total_nhits = total_nhits + nhits
      total_phits = total_phits + phits
      Grand_total_hits= total_nhits + total_phits
      '
      msg = "feature (" & fcntr & ") ID = " & fname
      msg = msg & chr(10) & "# of hits = " & nhits
      msg = msg & chr(10) & "TOTAL # of hits = " & total_nhits
      Msg = msg & chr(10) & "# of SAMPLE hits = " & phits
      msg = msg & chr(10) & "TOTAL # of SAMPLE hits = " & total_phits & chr(10)
      msg = msg & chr(10) & "GRAND TOTAL # of hits = " & total_phits & chr(10)
      msgbox msg
      '
      End If
      '
      If Fcntr >= Fcntr2-1 Then
      Goto Exit_Sub
      End If
      Next cmd
      
      Exit_Sub
      
      Set PCDApp = nothing
      Set PCDPartPrograms =nothing
      Set PCDPartProgram = nothing
      End Sub

      B&S CHAMELEON/PCDMIS CAD++ V2011

      There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

      sigpic

      Comment


      • #4
        At the end of the program create a point cloud from all the features, that should tell you the number of hits.

        Comment


        • #5
          Wearable items? Can someone explain this to me?

          Comment


          • #6
            Originally posted by ThePudds View Post
            Wearable items? Can someone explain this to me?
            The probing unit has an expected lifespan of just so many hits. It might be useful info to track the number of hits taken.

            B&S CHAMELEON/PCDMIS CAD++ V2011

            There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

            sigpic

            Comment


            • jtrofatter
              jtrofatter commented
              Editing a comment
              Exactly! i had to replace a bunch of tp modules recently. There was a few in our cabinet and i assumed they were back up brand new modules. turns out thats just where they were storing the used ones before i took over as the lab lead. so when i told them i needed like $6k in modules, they definitely had some questions even though i pointed out they hadnt spent money on any of these in 6 years. Either way they requested some sort of proactive plan to avoid this is in the future. best way i know how is give them an average of about how often we would reach the expected lifespan of the units in a perfect world.

          Related Topics

          Collapse

          Working...
          X