hexagon logo

Need help on OUTTOL.BAS file

I have used this script many time and have even made a couple minor mods.
Here is my issue. It is looking for "END OF DIMENSION" and profiles and distances do not have this. It skips over and ignore those. Anybody have an idea as to how I can mod this script to do this ???

Time is critical, I appreciate anyone who responds and helps !!

For Each Cmd In Cmds
    ' if the command of the current iteration is a dimension ...
    If Cmd.IsDimension Then
      ' and it is not a start or end dimension object ...
      If Cmd.Type <> DIMENSION_START_LOCATION And _
         Cmd.Type <> DIMENSION_END_LOCATION And _
         Cmd.Type <> DIMENSION_TRUE_START_POSITION And _
         Cmd.Type <> DIMENSION_TRUE_END_POSITION Then
        ' then get the dimensioncommand object from the command
        Set DimCmd = Cmd.DimensionCommand
        ' If it is out of tolerance, increment numberout, otherwise increment numberin
        If DimCmd.OutTol > 0 Then
          NumberOut = NumberOut + 1
        Else
Parents
  • This already throws up a messagebox in the code:

    If dblouttol > 0 Then 
      [COLOR="Red"][U] MsgBox "Part is BAD!" & Chr(10) & "Number of Dimensions Out of Tolerance:" & dblouttol & Chr(10) &"Features out of tolerance:" & Chr(10) & Msg ' Display the ID's that are out of tolerance[/U][/COLOR]   Set Var = objPART.GetVariableValue ("SUB_OUTTOLNUM")        'Grabs the variable SUB_OUTTOLNUM from the subroutine program
       Var.stringvalue  = dblOutTol                                      'Sets variable As number of outtol dimensions. Change this To actual CMM Name/number
       Set Var2 = objPART.getvariablevalue ("SUB_ACCEPTREJECT")  'Grabs the variable Sub_ACCEPTREJECT from the subroutine program
       var2.stringvalue = "~~4 REJECTED"                                                                       'Sets variable As Accept, As part is good
                    
    End If


    Not only does it give you number outtol, it gives you the feature it was outtol on. The set variable lines are to put those outtol numbers into variables in my program. You can just put a ' in front of them.

    The code that makes a debug text file that Jan had has just been changed to comments, so it will not execute. There is no export to file anything.
Reply
  • This already throws up a messagebox in the code:

    If dblouttol > 0 Then 
      [COLOR="Red"][U] MsgBox "Part is BAD!" & Chr(10) & "Number of Dimensions Out of Tolerance:" & dblouttol & Chr(10) &"Features out of tolerance:" & Chr(10) & Msg ' Display the ID's that are out of tolerance[/U][/COLOR]   Set Var = objPART.GetVariableValue ("SUB_OUTTOLNUM")        'Grabs the variable SUB_OUTTOLNUM from the subroutine program
       Var.stringvalue  = dblOutTol                                      'Sets variable As number of outtol dimensions. Change this To actual CMM Name/number
       Set Var2 = objPART.getvariablevalue ("SUB_ACCEPTREJECT")  'Grabs the variable Sub_ACCEPTREJECT from the subroutine program
       var2.stringvalue = "~~4 REJECTED"                                                                       'Sets variable As Accept, As part is good
                    
    End If


    Not only does it give you number outtol, it gives you the feature it was outtol on. The set variable lines are to put those outtol numbers into variables in my program. You can just put a ' in front of them.

    The code that makes a debug text file that Jan had has just been changed to comments, so it will not execute. There is no export to file anything.
Children
No Data