hexagon logo

Set A Variable in PC-DMIS with a textbox in VB.Net

Hi guys,

I have taken on the task of automating our CMM operations, and so far I have been able to push through some of my issues but I am stumped on this one. All I want to do is have the VB program output whatever is written in a textbox into a variable on PC-Dmis.

Thanks for the help.
Matt
Parents
  • NinjaBadger you are the man that worked flawlessly. Thank you everyone for you help.

    Here is the code:
        'Set Program Variables
        Public Sub VarSet()
            Dim pcd As PCDLRN.Application
            pcd = CreateObject("pcdlrn.application")
            Dim pcpart As PCDLRN.PartProgram
            pcpart = pcd.ActivePartProgram
    
            Dim cmds As PCDLRN.Commands
            cmds = pcpart.Commands
    
            Dim cmd As PCDLRN.Command
            For i As Integer = 1 To cmds.Count
                cmd = cmds.Item(i)
                If cmd.IsFlowControl Then
                    If cmd.TypeDescription = "Assignment" And cmd.GetText(PCDLRN.ENUM_FIELD_TYPES.DEST_EXPR, 0) = "JOBNO" Then
    
    
                        cmd.PutText("" & TextBox3.Text & "", PCDLRN.ENUM_FIELD_TYPES.SRC_EXPR, 0)
    
    
                    End If
                End If
    
    
            Next
            endForm()
        End Sub
    
Reply
  • NinjaBadger you are the man that worked flawlessly. Thank you everyone for you help.

    Here is the code:
        'Set Program Variables
        Public Sub VarSet()
            Dim pcd As PCDLRN.Application
            pcd = CreateObject("pcdlrn.application")
            Dim pcpart As PCDLRN.PartProgram
            pcpart = pcd.ActivePartProgram
    
            Dim cmds As PCDLRN.Commands
            cmds = pcpart.Commands
    
            Dim cmd As PCDLRN.Command
            For i As Integer = 1 To cmds.Count
                cmd = cmds.Item(i)
                If cmd.IsFlowControl Then
                    If cmd.TypeDescription = "Assignment" And cmd.GetText(PCDLRN.ENUM_FIELD_TYPES.DEST_EXPR, 0) = "JOBNO" Then
    
    
                        cmd.PutText("" & TextBox3.Text & "", PCDLRN.ENUM_FIELD_TYPES.SRC_EXPR, 0)
    
    
                    End If
                End If
    
    
            Next
            endForm()
        End Sub
    
Children
No Data