Count all OUTTOLS regardless of Legacy or XactMeasure

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

  • Count all OUTTOLS regardless of Legacy or XactMeasure

    Finding all OUTTOLs for legacy dimensions is easy and the widely distributed OUTTOL.BAS, especially with the CRAIGER modifications, is very easy to use. However, it does NOT work for the XactMeasure GD&T. This was confirmed by Hexagon.

    Below is a simple piece of code that checks for both the Legacy AND XactMeasure GD&T for OUTTOL conditions. It even checks the XactMeasure in the second tier in case of composite FCF's.

    As a debug tool, I decided to store all OUTTOLS in a file called COMMANDS.TXT. This file has no value, other then that it helps to understand how this script works.

    There is still the issue of profile. Profile is not properly evaluated by PC-DMIS. This has been reported numerous times but Hexagon informed me that they believe they do it right. If you want to correctly evaluate profile you will have to add your own code. I may do that in the future, if this becomes a real issue for me.


    Jan.


    Code:
    Sub Main()
    
    'This *.bas is a simple, modified version of Craigs modified outtol.bas (whose original author nobody seems To know).
    'Jan.
    
    'What it does:
    'It takes all Dimensions that have an ID that starts With CD (For Critical dimension), regardless whether they are legacy Or XactMeasure.
    'Then it will look whether this dimension is out of tolerance Or Not. 
    ' If it is OutTol, it will increase PC-DMIS variable "NUMBEROUTTOL".
    ' This works also For the second tier of the FCF For the XactMeasure GD&T.
    ' One known problem: this does Not address the XactMeasure Profile tolerance issue (PC-DMIS does Not evaluate that properly). To correct this
    ' a lot more code will need To be developed.
    ' For debug purposes, the results are stored In a file called COMMANDS.TXT. 
    
    Dim objApp As Object
    Set objApp = CreateObject("PCDLRN.Application")
    Dim objPart As Object
    Set objPart = objApp.ActivePartProgram
    Dim objCmds As Object
    Set objCmds = objPart.Commands
    Dim objCmd As Object
    Dim objDimCmd As Object
    Dim dblOutTol As Long
    dblOutTol = 0
    Dim objOutTol As Object
    Set objOutTol = objPart.GetVariableValue("NUMBEROUTTOL")               'number of outtols found
    
    Open "C:\PCDMISW\COMMANDS.TXT" For Output As #3
    
    Dim objCmdIDName As String
    Dim prevIDName As String
    Dim objCmdDeviation As Double
    Dim objCmdOuttol As Double
    For Each objCmd In objCmds    
        objCmdIDName=objCmd.ID          'capture the ID Name of the command that is being looked at.
       
        If objCmdIDName="" Then            'Make sure that commands always have a Name.      
            objCmdIDName=prevIDName
        End If
        prevIDName= objCmdIDName       'save the old Name just In Case the Next one is ""
    
        'First Step: hunt For all the dimensions that start With CD For Critical Dimension.
    
        If left(objCmdIDName,2)="CD" Then        'If you find a cmd that starts With CD, Then there are 2 posibilities.
        
            'Second Step: first possibility: hunt For legacy dimensions
            
            If objCmd.IsDimension Then
                Set objDimCmd=objCmd.DimensionCommand
                If objDimCmd.OutTol<>0 Then
                    dblOutTol=dblOutTol+1
                End If 'objDimCmd.OutTol<>0
                Print #3, "***LEGACY***" & objCmdIDName & "***"
                Print #3, "OUTTOL number: " & objDimCmd.OutTol
                Print #3, "Number out of tolerance: " & dblOutTol
                Print #3, ""
            End If 'objCmd.IsDimension 
    
            'Third Step: second possibility: hunt For XactMeasure GD&T dimensions    
    
            If objCmd.Type=184 Then           'this seems To be the way To find an XactMeasure GD&T Call.
    
                If objCmd.gettext(LINE1_OUTTOL,1)<>"" Then   'look In Line 1 For an OUTTOL
                    If objCmd.gettext(LINE1_OUTTOL,1)<>0 Then   'If there is an OUTTOL In Line 1, is it Not zero?
                        dblOutTol=dblOutTol+1
                    End If 'objCmd.gettext(LINE1_OUTTOL,1)<>0
                    Print #3, "***XactMeasure Line1***" & objCmdIDName & "***"
                    Print #3, "OUTTOL number: " & objCmd.gettext(LINE1_OUTTOL,1)
                    Print #3, "Number out of tolerance: " & dblOutTol
                    Print #3, ""
                End If 'objCmd.gettext(LINE1_OUTTOL,1)<>""
               
                If objCmd.gettext(LINE2_OUTTOL,1)<>"" Then   'look In Line 2 For an OUTTOL
                    If objCmd.gettext(LINE2_OUTTOL,1)<>0 Then   'If there is an OUTTOL In Line 2, is it Not zero?
                        dblOutTol=dblOutTol+1
                    End If 'objCmd.gettext(LINE1_OUTTOL,1)<>0
                    Print #3, "***XactMeasure Line2***" & objCmdIDName & "***"
                    Print #3, "OUTTOL number: " & objCmd.gettext(LINE2_OUTTOL,1)
                    Print #3, "Number out of tolerance: " & dblOutTol
                    Print #3, ""
                End If 'objCmd.gettext(LINE2_OUTTOL,1)<>""
    
                If objCmd.gettext(LINE3_OUTTOL,1)<>"" Then   'look In Line 3 For an OUTTOL
                    If objCmd.gettext(LINE3_OUTTOL,1)<>0 Then   'If there is an OUTTOL In Line 3, is it Not zero?
                        dblOutTol=dblOutTol+1
                    End If 'objCmd.gettext(LINE3_OUTTOL,1)<>0
                    Print #3, "***XactMeasure Line3***" & objCmdIDName & "***"
                    Print #3, "OUTTOL number: " & objCmd.gettext(LINE3_OUTTOL,1)
                    Print #3, "Number out of tolerance: " & dblOutTol
                    Print #3, ""
                End If 'objCmd.gettext(LINE3_OUTTOL,1)<>""
    
    
            End If 'objCmd.Type=184
    
        End If 'left(objCmdIDName,2)="CD"
       
    Next objCmd
    
    Close #3
    
    objOutTol.DoubleValue=dblOutTol
    objPart.SetVariableValue "NUMBEROUTTOL",objOutTol
    
    End Sub
    'Jan
    ***************************
    PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
    Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

  • #2
    Originally posted by Jan d. View Post
    There is still the issue of profile. Profile is not properly evaluated by PC-DMIS. This has been reported numerous times but Hexagon informed me that they believe they do it right. If you want to correctly evaluate profile you will have to add your own code. I may do that in the future, if this becomes a real issue for me.


    Jan.

    Here is what I have done to get PCD to report Profile the way we use it:

    Code:
     
    ASSIGN/V1 = ABS(PROFX.MAX)
    ASSIGN/V2 = ABS(PROFX.MIN)
    IF/V1>V2
    ASSIGN/V3 = (V1*2)
    END_IF/
    IF/V1<V2
    ASSIGN/V3 = (V2*2)
    END_IF/
    COMMENT/REPT,+++++++++++++++
    COMMENT/REPT,"Extended PROF = " + V3
    COMMENT/REPT,+++++++++++++++
    You will need to enter this after each Profile and insert the correct PROF where it shows "PROFX"

    An example of what you get in the Report (with Textual anaylis turned on):
    Code:
     
    =====
    C1-B
    =====
    DIM PROF24= PROFILE OF SURFACE OF SET SCN-CENTER_FLAT_ASIDE FORMANDLOCATION UNITS=IN
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL 
    M 0.0000 0.0300 0.0300 0.0198 0.0198 0.0000 ---#
     
    POINTDATA HIT# MEAS X Y Z VEC I J K DEVIATION
    SCN-CENTER_FLAT_ASIDE 
    1 5.2460 31.5407 0.0868 -0.0858 -0.0116 0.9962 0.0183 
    2 5.7146 28.0491 0.0949 -0.0883 -0.0079 0.9961 0.0191 
    3 5.2836 24.9810 0.0357 -0.0917 -0.0048 0.9958 0.0198 MAX
    4 5.7336 22.0655 0.0638 -0.0926 -0.0031 0.9957 0.0178 
    5 5.2786 19.0039 0.0082 -0.1059 -0.0027 0.9944 0.0159 
    6 5.7568 16.0258 0.0593 -0.1268 0.0024 0.9919 0.0138 
    7 5.2675 12.9780 0.0014 -0.1399 0.0022 0.9902 0.0133 
    8 5.7557 10.0125 0.0866 -0.1533 0.0082 0.9881 0.0100 
    9 5.2772 6.9780 0.0412 -0.1555 0.0112 0.9878 0.0099 
    10 5.7437 4.0117 0.1493 -0.1537 0.0147 0.9880 0.0058 
    11 5.3017 0.5916 0.1390 -0.1458 0.0195 0.9891 0.0037 MIN
     
    +++++++++++++++
    Extended PROF = 0.0397
    +++++++++++++++
    Last edited by John Riggins; 09-14-2007, 05:33 PM.
    Lately, it occurs to me
    What a long, strange trip it's been.

    2017 R1 (Offline programming)

    Comment


    • #3
      very helpful,thanks.
      PC-DMIS 3.7 mr3

      Comment

      Related Topics

      Collapse

      Working...
      X