hexagon logo

Creation of a script for a toolbar button to insert a command line

Hello all!!

How to create a script to insert this command lines in a program?
In the end i want to create a button for a toolbar that runs this script.


C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Dimensional Numero: ?
C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Molde Numero: ?
C3 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Nome do Molde (Cliente): ?
C4 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Referencia das peças: ?
C5 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Quantidade de Peças: ?
C6 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Teste Numero: ?
C7 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Revisão do Relatório: ?
C8 =COMMENT/INPUT,NO,FULL SCREEN=NO,
Elaborado por: ?



Thank you in advanced for the help.

Lionheart1º
Parents
  • So lost need some major help with this scripting. So I took this old script of Josh's and I want to revise a little. Don't want to start deleting stuff and then become completely lost. Here is my Plan. I'm creating 1 program with 4 different Operations. At the beginning all I want is for the Operator to choose the right Op. and when they choose that it goes to a Label in the Program. So how about or and a little help? This is what I have so far I know its a mess, but don't want it to get messier. or even your pretty good at this sh_it.





    
    Sub Main
    '''''Create Dialog With these Input items:
    Begin Dialog DIALOG_1 50,10, 1000, 500,      oOPERATORINPUT
      TextBox 85,13,135,12, .EditBox_1
      TextBox 95,43,135,12, .EditBox_2
      TextBox 105,73,135,12, .EditBox_3
      OptionGroup .GROUP_2
        Button 55,15,800,100, "WORK ORDER #20"
        Button 55,125,800,100, "WORK ORDER #30"
        Button 55,235,800,100, "WORK ORDER #40"
        Button 55,345,800,100, "WORK ORDER #50"
          OKButton 195,210,65,45
      CancelButton 120,275,48,16
    End Dialog
    
    ''''' Set the Dialog For Access:
    Dim Dialg As DIALOG_1
    button1 = Dialog(Dialg)
    
    ''''' Declar VB variables:
    Dim Progtype As String
    Dim SerNum As String
    Dim MANUALQ As String
    MANUALQ= "YES"
    
    '''''Quit If Dialog got canceled, Or go On To take the operator inputs And Put them into VB variables:
    If button1 = 0 Then
      Progtype= "END"
    Else
    
      Select Case Dialg.GROUP_2
        Case 0
          MANUALQ= "YES"
        Case 1
          MANUALQ= "NO"
      End Select
    
    
    
     End If
    
    '''''Link up To PC-DMIS:
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Cmds As Object
    Dim Cmd As Object
    Set Cmds = Part.Commands
    
    '''''Find the PC-DMIS variables And fill their values In With the current values of VB variables:
    For Each Cmd In Cmds
      If Cmd.Type = ASSIGNMENT Then
        If Cmd.GetText(DEST_EXPR, 0) = "OPERATOR" Then
          bln = Cmd.PutText("""" + Oper + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
        If Cmd.GetText(DEST_EXPR, 0) = "JOB" Then
          bln = Cmd.PutText("""" + Job + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
        If Cmd.GetText(DEST_EXPR,0) = "SERNO" Then
          bln = Cmd.PutText("""" + SerNum + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
        If Cmd.GetText(DEST_EXPR,0) = "MANUAL" Then
          bln = Cmd.PutText("""" + MANUALQ + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
      End If
    Next Cmd
    
    '''''Finish.
    End Sub
    
    
    
Reply
  • So lost need some major help with this scripting. So I took this old script of Josh's and I want to revise a little. Don't want to start deleting stuff and then become completely lost. Here is my Plan. I'm creating 1 program with 4 different Operations. At the beginning all I want is for the Operator to choose the right Op. and when they choose that it goes to a Label in the Program. So how about or and a little help? This is what I have so far I know its a mess, but don't want it to get messier. or even your pretty good at this sh_it.





    
    Sub Main
    '''''Create Dialog With these Input items:
    Begin Dialog DIALOG_1 50,10, 1000, 500,      oOPERATORINPUT
      TextBox 85,13,135,12, .EditBox_1
      TextBox 95,43,135,12, .EditBox_2
      TextBox 105,73,135,12, .EditBox_3
      OptionGroup .GROUP_2
        Button 55,15,800,100, "WORK ORDER #20"
        Button 55,125,800,100, "WORK ORDER #30"
        Button 55,235,800,100, "WORK ORDER #40"
        Button 55,345,800,100, "WORK ORDER #50"
          OKButton 195,210,65,45
      CancelButton 120,275,48,16
    End Dialog
    
    ''''' Set the Dialog For Access:
    Dim Dialg As DIALOG_1
    button1 = Dialog(Dialg)
    
    ''''' Declar VB variables:
    Dim Progtype As String
    Dim SerNum As String
    Dim MANUALQ As String
    MANUALQ= "YES"
    
    '''''Quit If Dialog got canceled, Or go On To take the operator inputs And Put them into VB variables:
    If button1 = 0 Then
      Progtype= "END"
    Else
    
      Select Case Dialg.GROUP_2
        Case 0
          MANUALQ= "YES"
        Case 1
          MANUALQ= "NO"
      End Select
    
    
    
     End If
    
    '''''Link up To PC-DMIS:
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Cmds As Object
    Dim Cmd As Object
    Set Cmds = Part.Commands
    
    '''''Find the PC-DMIS variables And fill their values In With the current values of VB variables:
    For Each Cmd In Cmds
      If Cmd.Type = ASSIGNMENT Then
        If Cmd.GetText(DEST_EXPR, 0) = "OPERATOR" Then
          bln = Cmd.PutText("""" + Oper + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
        If Cmd.GetText(DEST_EXPR, 0) = "JOB" Then
          bln = Cmd.PutText("""" + Job + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
        If Cmd.GetText(DEST_EXPR,0) = "SERNO" Then
          bln = Cmd.PutText("""" + SerNum + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
        If Cmd.GetText(DEST_EXPR,0) = "MANUAL" Then
          bln = Cmd.PutText("""" + MANUALQ + """", SRC_EXPR, 0)
          Cmd.ReDraw
        End If
      End If
    Next Cmd
    
    '''''Finish.
    End Sub
    
    
    
Children