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
  • Unfortunately the structure of this quite old script doesn't lend itself to that modification. Many legacy dimensions have a structure containing multiple commands (DIMENSION_START, axis1, axis2, … , axisN, DIMENSION_END), and the OutputMode flag (and dimension ID) is only available on the DIMENSION_START command, so the obvious mod,

    
    For cnt = 1 To objCmds.Count
     Set objCmd = objCmds.Item(cnt)
    
    
    If objCmd.marked = True Then   'CHECK For MARKED DIMENSIONS HERE
    
    
        If objCmd.IsDimension  Then
    
    [COLOR=#FF0000]       Set objDimCmd = objCmd.DimensionCommand
            If (objDimCmd.OutputMode = DIMOUTPUT_NONE) Or (objDimCmd.OutputMode = DIMOUTPUT_STATS) Then
              GoTo NextCommand
            End If[/COLOR]
    
           <the rest of the code>
    
    [COLOR=#FF0000]NextCommand:[/COLOR]
    Next cnt
    
    
    


    doesn't work. The script would have to be rewritten to detect the DIMENSION_START, save the OutputMode, and be in state "in a multi line dimension" until DIMENSION_END. I don't have the time for that, but maybe someone else feel adventurous...
Reply
  • Unfortunately the structure of this quite old script doesn't lend itself to that modification. Many legacy dimensions have a structure containing multiple commands (DIMENSION_START, axis1, axis2, … , axisN, DIMENSION_END), and the OutputMode flag (and dimension ID) is only available on the DIMENSION_START command, so the obvious mod,

    
    For cnt = 1 To objCmds.Count
     Set objCmd = objCmds.Item(cnt)
    
    
    If objCmd.marked = True Then   'CHECK For MARKED DIMENSIONS HERE
    
    
        If objCmd.IsDimension  Then
    
    [COLOR=#FF0000]       Set objDimCmd = objCmd.DimensionCommand
            If (objDimCmd.OutputMode = DIMOUTPUT_NONE) Or (objDimCmd.OutputMode = DIMOUTPUT_STATS) Then
              GoTo NextCommand
            End If[/COLOR]
    
           <the rest of the code>
    
    [COLOR=#FF0000]NextCommand:[/COLOR]
    Next cnt
    
    
    


    doesn't work. The script would have to be rewritten to detect the DIMENSION_START, save the OutputMode, and be in state "in a multi line dimension" until DIMENSION_END. I don't have the time for that, but maybe someone else feel adventurous...
Children
  • Andersl,

    Thanks for bit of info. I have script which exporting data to excel and I'm thinking that structure should be similar. That script depends on type of commands, if yes then I should use :
    If Cmd.Type <> 1299 then
    If Cmd.Type = 1118 then
    if Cmd.Type = 1105 then
    If Cmd.Type = 184 then

    Next step:

    If Cmd.IsDimension Then
    If Cmd.Type = DIMENSION_START_LOCATION Or/and Cmd.Type = DIMENSION_TRUE_START_POSITION Then

    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


    If I do understand well COMMQAND.Type should ensure that script will not miss any type of countable dimension and DIMENSION_START/DIMENSION_END will describe where script should look for "OUT OF TOLERANCE". Am I right?