hexagon logo

Getprograminfo

Trying to start converting our PDMIS program to output to a PDF. I've gotten all of the variables setup to store the reports based on things like part name, time, date. But I'm trying to add an if/then statement to change the file name to indicate that a dimension failed.

I've search the forums here and people are using:

ASSIGN/NUMOOT=GETPROGRAMINFO("NUMOOT")

But it always reads a 0.

I'm using v2013, is it not the correct code for this version? Am I missing something before this line? Will it always show 0 offline? (I forced a nominal to make it OOT)
Parents
  • you can write a basic script to get the value, then assign to a pcdmis variable.
    This will use the oldBasic interface to access the out of tolerance variable.
    I imagine someone on the forum has a script to set a pcdmis variable.
    The script still needs to be after all the dimensions that you are interested in.

    Sub main()
    
    Dim PcdApp, PcdPart As Object
    Dim newcnt As Integer
    Dim basicInterface As Object
    
    Set PcdApp = CreateObject("Pcdlrn.Application")
    If PcdApp Is Nothing Then
    MsgBox("Application is not loaded, exiting.")
    GoTo endme
    End If
    
    Set pcdPart = PcdApp.ActivePartProgram
    If PcdPart Is Nothing Then
    MsgBox("Unable to find an active part program. Please have a part program loaded when this script is used.")
    Set PcdApp = Nothing
    GoTo endme
    End If
    
    Set basicInterface = pcdPart.OldBasic
    If basicInterface Is Nothing Then
    MsgBox("Unable to get basic interface.")
    Set PcdApp = Nothing
    GoTo endme
    End If
    
    newcnt = basicInterface.GetDimOutTol
    MsgBox "The Number of Out of Tolerance dimensions are: " & newcnt
    
    Set basicInterface = Nothing
    Set PcdApp = Nothing
    
    endme:
    End Sub
    
Reply
  • you can write a basic script to get the value, then assign to a pcdmis variable.
    This will use the oldBasic interface to access the out of tolerance variable.
    I imagine someone on the forum has a script to set a pcdmis variable.
    The script still needs to be after all the dimensions that you are interested in.

    Sub main()
    
    Dim PcdApp, PcdPart As Object
    Dim newcnt As Integer
    Dim basicInterface As Object
    
    Set PcdApp = CreateObject("Pcdlrn.Application")
    If PcdApp Is Nothing Then
    MsgBox("Application is not loaded, exiting.")
    GoTo endme
    End If
    
    Set pcdPart = PcdApp.ActivePartProgram
    If PcdPart Is Nothing Then
    MsgBox("Unable to find an active part program. Please have a part program loaded when this script is used.")
    Set PcdApp = Nothing
    GoTo endme
    End If
    
    Set basicInterface = pcdPart.OldBasic
    If basicInterface Is Nothing Then
    MsgBox("Unable to get basic interface.")
    Set PcdApp = Nothing
    GoTo endme
    End If
    
    newcnt = basicInterface.GetDimOutTol
    MsgBox "The Number of Out of Tolerance dimensions are: " & newcnt
    
    Set basicInterface = Nothing
    Set PcdApp = Nothing
    
    endme:
    End Sub
    
Children
No Data