Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Custom Comment Script, upgraded

  1. #1
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default Custom Comment Script, upgraded

    I have a version of this script hooked to a custom icon so with one-click I can run it and add comments quickly, or add canned (standadized) comments quickly.

    Credit goes to Nate on the other forum.

    I've modified it 10,000 times to suit my whims of whatever silly text character strings I like to add. My personal version has 13 different canned $$ comments.

    One thing I noticed that could be construed as a bug:
    If in your PC-DMIS program you have a $$ comment that you want to show on the report, you may toggle it from NO to YES.

    However once you do that, any subsequent $$ comments you add with the BAS all default to YES display on the report.

    So I fixed it.

    Also new is a Form Feed checkbox to space your report out alot.

    Code:
    'Custom Comment Script
    Sub Main()
    
    Dim buttonval As Integer
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    Dim Cmds As Object
    Set Cmds = Part.Commands
    
    Dim PartProg As Object
    Set PartProg = App.ActivePartProgram
    
    Dim Cmd As Object
    
    Begin Dialog DLG_REPORT_COMMENT 50, 32, 290, 300, "What Comments Do You Need?"
    
    
    OKButton 225, 175, 50, 25
    
    
    
    CheckBox 12, 10, 150, 8, "$$ THAT COMMENT YOU ALWAYS USE", .CheckBox1
    
    CheckBox 205, 10, 60, 8, "FORM FEED", .CheckBox13
    
    
    Text 12, 35, 120, 8, "Custom $$ Comment:"
    TextBox 15, 45, 180, 12, .EditBox13
    TextBox 15, 55, 180, 12, .EditBox14
    TextBox 15, 65, 180, 12, .EditBox15
    
    Text 12, 85, 125, 8, "Custom Report Comment:"
    TextBox 15, 95, 180, 12, .EditBox1
    TextBox 15, 105, 180, 12, .EditBox2
    TextBox 15, 115, 180, 12, .EditBox3
    
    Text 12, 135, 125, 8, "Custom Operator Comment:"
    TextBox 15, 145, 180, 12, .EditBox23
    TextBox 15, 155, 180, 12, .EditBox24
    TextBox 15, 165, 180, 12, .EditBox25
    TextBox 15, 175, 180, 12, .EditBox26
    TextBox 15, 185, 180, 12, .EditBox27
    TextBox 15, 195, 180, 12, .EditBox28
    
    End Dialog
    
    '-------------------------------------------------------------------------------------------------------
    
    Dim dlg1 As DLG_REPORT_COMMENT
    buttonval = Dialog(dlg1)
    If button1 = 0 Then
    
    Dim customstr1 As String
    customstr1 = dlg1.EditBox1
    Dim lenstr1 As Integer
    lenstr1 = Len(dlg1.EditBox1)
    
    Dim customstr2 As String
    customstr2 = dlg1.EditBox2
    Dim lenstr2 As Integer
    lenstr2 = Len(dlg1.EditBox2)
    
    Dim customstr3 As String
    customstr3 = dlg1.EditBox3
    Dim lenstr3 As Integer
    lenstr3 = Len(dlg1.EditBox3)
    
    '
    
    Dim customstr13 As String
    customstr13 = dlg1.EditBox13
    Dim lenstr13 As Integer
    lenstr13 = Len(dlg1.EditBox13)
    
    Dim customstr14 As String
    customstr14 = dlg1.EditBox14
    Dim lenstr14 As Integer
    lenstr14 = Len(dlg1.EditBox14)
    
    Dim customstr15 As String
    customstr15 = dlg1.EditBox15
    Dim lenstr15 As Integer
    lenstr15 = Len(dlg1.EditBox15)
    
    '
    
    
    Dim customstr23 As String
    customstr23 = dlg1.EditBox23
    Dim lenstr23 As Integer
    lenstr23 = Len(dlg1.EditBox23)
    
    Dim customstr24 As String
    customstr24 = dlg1.EditBox24
    Dim lenstr24 As Integer
    lenstr24 = Len(dlg1.EditBox24)
    
    Dim customstr25 As String
    customstr25 = dlg1.EditBox25
    Dim lenstr25 As Integer
    lenstr25 = Len(dlg1.EditBox25)
    
    Dim customstr26 As String
    customstr26 = dlg1.EditBox26
    Dim lenstr26 As Integer
    lenstr26 = Len(dlg1.EditBox26)
    
    Dim customstr27 As String
    customstr27 = dlg1.EditBox27
    Dim lenstr27 As Integer
    lenstr27 = Len(dlg1.EditBox27)
    
    Dim customstr28 As String
    customstr28 = dlg1.EditBox28
    Dim lenstr28 As Integer
    lenstr28 = Len(dlg1.EditBox28)
    
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
    If dlg1.CheckBox1 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    If dlg1.CheckBox1 = 1 Then
    retvaltype = Cmd.PutText("THAT COMMENT YOU ALWAYS USE", COMMENT_FIELD, 1)
    End If
    Cmd.ReDraw
    End If
    
    
    If dlg1.CheckBox13 = 1 Then
    Set Cmd = Cmds.Add(PRINT_FORM_FEED, TRUE)
    End If
    
    
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    If lenstr1 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr1, COMMENT_FIELD, 1)
    If lenstr2 > 0 Then
    retvaltype = Cmd.PutText(customstr2, COMMENT_FIELD, 2)
    End If
    If lenstr3 > 0 Then
    retvaltype = Cmd.PutText(customstr3, COMMENT_FIELD, 3)
    End If
    Cmd.ReDraw
    End If
    
    If lenstr13 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 1)
    If lenstr14 > 0 Then
    retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 2)
    End If
    If lenstr15 > 0 Then
    retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 3)
    End If
    Cmd.ReDraw
    End If
    
    
    If lenstr23 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 1)
    If lenstr24 > 0 Then
    retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
    End If
    If lenstr25 > 0 Then
    retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
    End If
    If lenstr26 > 0 Then
    retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
    End If
    If lenstr27 > 0 Then
    retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
    End If
    If lenstr28 > 0 Then
    retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
    End If
    Cmd.ReDraw
    End If
    
    End If
    End Sub



    To add a script to a custom icon:
    Right-click on toolbar area
    Select customize

    On left-most tab "Menu", click on Create Item
    Use the ... button to navigate to where the BAS is stored
    It won't show up - you gotta toggle the Files Of Type to Basic Script
    Choose it
    Now there's a Change Icon buton too, google free icons there's a bazillion out there.

    Now go to Toolbars tab
    There click on New then Toolbar
    Now you can Add your new Item to your new toolbar from the bottom-most User Defined Commands.

    Done.

    Profit.
    Last edited by Josh Carpenter; 03-26-2012 at 03:41 PM.
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  2. #2
    PC-DMIS Guru
    • Additional Information
      • Years CMM Experience:
      • Since 1994
      • Software Version:
      • PC-DMIS CAD++ 2014.1
      • Machine Type:
      • CEJ12C, CEJ12000
      • Location:
      • Sweden
      • Job Function:
      • Quality tech., CMM programmer/operator
    vpt.se's Avatar
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    4,867

    Default

    Thanks for sharing!
    PC-DMIS CAD++ 2o14.1

  3. #3
    Junior Member
    • Additional Information
      • Years CMM Experience:
      • 15
      • Software Version:
      • 4.3
      • Machine Type:
      • B&S XCEL
      • Location:
      • New Brunswick, Canada
      • Job Function:
      • Programmer

    Join Date
    Apr 2008
    Location
    New Brunswick, Canada
    Posts
    18

    Default Fixing the $$ Comment toggle to YES/NO?

    Hi Josh,
    I've just encountered the $$ toggling to YES after I used a BAS button (to add autosave writing to pdf with date/time/filehedr).
    You said you fixed this behaviour - what bit of your code do I need? I want all $$ to always be NO.
    Thanks
    Mark

  4. #4
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default

    I did a total revamp, adding some new bells and whistles and cleaning up the layout.
    Had to chop this up into several posts, 10k character limit slays me.
    Code:
    '______________________ CUSTOM COMMENTS ___________________________________________________________
    '                v8, Josh Carpenter April 3013
    'TOTALLY FREE OPEN SOURCE CODE NO TRADEMARK OR COPYRIGHT WHATSOEVER
    'NO WARRANTY OR GUARANTEE IMPLIED OR SPECIFIED
    'ONLY FOR USE WITH PC-DMIS SOFTWARE copyright Wilcox Associates
    
    'Version 8 addes the ability to create and use one new 'canned' comment.
    ' It requires system permission to write a text file to C:\TEMP
    ' Only one new canned comment is possible, and will be overwritten
    ' by selecting "make this a New Canned Comment" checkbox.
     
    Sub Main()
    Dim buttonval As Integer
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram
    Dim Cmds As Object
    Set Cmds = Part.Commands
    Dim PartProg As Object
    Set PartProg = App.ActivePartProgram
    Dim Cmd As Object
    
    Begin Dialog DLG_REPORT_COMMENT 50, 32, 415, 350, "What Comments Do You Need?"
    
    CheckBox 10, 7, 40, 8, "$$ <>", .CheckBox1
    CheckBox 50, 7, 40, 8, "$$ |", .CheckBoX8
    CheckBox 90, 7, 50, 8, "$$ - - - - -", .CheckBox5
    CheckBox 150, 7, 40, 8, "$$ /\/\/\", .CheckBox14
    
    CheckBox 10, 35, 50, 8, "$$ \\\ Slope", .CheckBox2
    CheckBox 10, 48, 50, 8, "$$ /// Slope", .CheckBox3
    
    CheckBox 80, 35, 50, 8, "$$ ||| Slope", .CheckBox9
    CheckBox 80, 48, 50, 8, "$$ ||| Slope", .CheckBox10
    
    CheckBox 150, 35, 50, 8, "$$ >>>>>", .CheckBox6
    CheckBox 150, 48, 50, 8, "$$ <<<<<", .CheckBox7
    
    CheckBox 130, 65, 30, 8, "$$ \ ", .CheckBox15
      Text   140, 73, 27, 8, "     /"
    
    CheckBox 170, 65, 40, 8, "$$ / ", .CheckBox16
      Text   180, 73, 27, 8, "     \"
    
    CheckBox 130, 90, 30, 8, "$$ \\\", .CheckBox19
        Text 150, 98, 20, 8, "///"
        Text 150, 106, 20, 8, "\\\"
    
    CheckBox 170, 90, 40, 8, "$$ ///", .CheckBox20
        Text 190, 98, 20, 8, "\\\"
        Text 190, 106, 20, 8, "///"
    
    CheckBox 150, 21, 50, 8, "$$ ~", .CheckBox17
    
    CheckBox 10, 21, 100, 8, "$$ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", .CheckBox18
    
    CheckBox 10, 65, 105, 8, "$$ !!! WARNING MOVE ALL !!!", .CheckBox11
    
    CheckBox 10, 78, 115, 8, "$$ _-_-_- PROBE CHANGE -_-_-_", .CheckBox12
    
    CheckBox 10, 92, 100, 8, "$$ ||| DIMENSIONS |||", .CheckBox4
    
    
    
    GroupBox 208, 3, 195,190
    GroupBox 206, 1, 199,194
    GroupBox 208, 3, 84,20
        Text 212, 10, 70, 8, "Custom $$ Comment:"
    CheckBox 320, 15, 70, 8, "NOTE:", .CheckBox7071
    CheckBox 212, 25, 135, 8, "$$ - - - - Program Revision Record - - - -", .CheckBoxE36
    Text     222, 35, 50, 8, "Created by:"
    TextBox 265, 35, 100, 10, .EditBoxE36
    CheckBox 212, 50, 145, 8, "$$ - - - - SETUP INSTRUCTIONS - - - -", .CheckBoxE46
    TextBox 215, 65, 180, 12, .EditBox13
    TextBox 215, 75, 180, 12, .EditBox14
    TextBox 215, 85, 180, 12, .EditBox15
    TextBox 215, 95, 180, 12, .EditBox16
    TextBox 215, 105, 180, 12, .EditBox17
    TextBox 215, 115, 180, 12, .EditBox18
    TextBox 215, 125, 180, 12, .EditBox19
    TextBox 215, 135, 180, 12, .EditBox20
    TextBox 215, 145, 180, 12, .EditBox21
    CheckBox 220, 165, 150, 8, "Make this a New Canned Comment", .CheckBox7072
    CheckBox 230, 180, 160, 8, "Use previously created New Canned Comment", .CheckBox7073
    
    
    GroupBox 8, 138,190,130
    GroupBox 6, 136,194,134
    GroupBox 8, 138, 70,20
    Text    12, 145, 65, 8, "Operator Comment:"
    CheckBox 90, 148, 70, 8, "CLICK OK, THEN...", .CheckBox2327
    TextBox 15, 160, 180, 12, .EditBox23
    TextBox 15, 170, 180, 12, .EditBox24
    TextBox 15, 180, 180, 12, .EditBox25
    TextBox 15, 190, 180, 12, .EditBox26
    TextBox 15, 200, 180, 12, .EditBox27
    TextBox 15, 210, 180, 12, .EditBox28
    CheckBox 120, 223, 70, 8, "... THEN CLICK OK", .CheckBox2328
     GroupBox 8,233,190,35
    CheckBox 20, 240, 65, 8, "Yes/No Question", .CheckBox2329
    CheckBox 120, 240, 65, 8, "Operator Input", .CheckBox2330
        Text 20, 252, 70, 8, "Required ID:"
    TextBox 70, 250, 80, 12, .EditBox29
    
    
    
    GroupBox 206, 206,199,124
    GroupBox 208, 208,195,120
    GroupBox 208, 208, 90,20
       Text 212, 215, 85, 8, "Custom Report Comment:"
       Text 320, 220, 80, 8, "Special Chars Brackets"
    Textbox 330, 230, 65, 8, .EditBox95
    CheckBox 220, 230, 80, 8, "SPACE LINE BEFORE", .CheckBox9193
     TextBox 215, 240, 180, 12, .EditBox91
     TextBox 215, 250, 180, 12, .EditBox92
     TextBox 215, 260, 180, 12, .EditBox93
    CheckBox 220, 275, 80, 8, "SPACE LINE AFTER", .CheckBox9194
    CheckBox 320, 275, 80, 8, "1-LINE BLANK", .CheckBox9195
    
         Text 215, 290, 50, 10, "Page #:"
      Textbox 245, 290, 40, 10, .Editbox202
    CheckBox 305, 290, 60, 8, "FORM FEED", .CheckBox133
         Text 230, 300, 140, 10, "View/Section/Detail:"
      Textbox 245, 310, 110, 10, .Editbox201
    
    
    
      GroupBox 13,296,88,38
      GroupBox 15,298,84,34
      GroupBox 17,300,80,30
          Text 22, 305, 70, 10, "# of Times to Repeat:"
       Textbox 45, 315, 20, 10, .Editbox650
    
    
    OKButton 135, 305, 50, 25
    
    End Dialog
    
    
    
    
    
    '-------------------------------------------------------------------------------------------------------
    ' Begin Actions Based on Inputs
    '-------------------------------------------------------------------------------------------------------
    
    Dim dlg1 As DLG_REPORT_COMMENT
    buttonval = Dialog(dlg1)
    
    
    Dim Repeater as Integer
    Repeater = dlg1.EditBox650
    
    Dim LR As Integer
    LR = Len(dlg1.EditBox650)
    
    If LR > 0 Then
    Repeater = dlg1.EditBox650
    End If
    
    If LR = 0 Then
    Repeater = 1
    End If
    
    
    '---------------------- LOOP FOR # OF TIMES TO REPEAT OPTION -------------------
    Do While Repeater > 0
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  5. #5
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default

    Code:
    '-------  SECTION A: CANNED COMMENTS -----------------------
    If dlg1.CheckBox1 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("<>", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox2 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("\\", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox3 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("///", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("//", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox4 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("||||||||||||||||||||||||||||||||||||||||||||||||||||", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("                      DIMENSIONS                     ", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("||||||||||||||||||||||||||||||||||||||||||||||||||||", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox5 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("-----", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox6 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText(">>>>>", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox7 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText(">>>>>", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox8 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("|", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("|", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("|", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox9 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("|", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("||", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("|||", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox10 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("|||", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("||", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("|", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox11 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("!!!!!!!!!!!!!!!!!!! WARNING MOVE ALL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox12 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("_-_-_-_-_-_-_-_-_-_-_- PROBE CHANGE -_-_-_-_-_-_-_-_-_-_-_-_-", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox14 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("^^^", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    
    '------------------------------
    If dlg1.CheckBox15 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(" \", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("  \", COMMENT_FIELD, 3)
    Cmd.ReDraw
    
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("  /", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(" /", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox16 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("  /", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(" /", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
    Cmd.ReDraw
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(" \", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("  \", COMMENT_FIELD, 3)
    End If
    '------------------------------
    If dlg1.CheckBox17 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("~", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox18 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", COMMENT_FIELD, 1)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox19 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(" \\\", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("  \\\", COMMENT_FIELD, 3)
    retvaltype = Cmd.PutText("  ///", COMMENT_FIELD, 4)
    retvaltype = Cmd.PutText(" ///", COMMENT_FIELD, 5)
    retvaltype = Cmd.PutText("///", COMMENT_FIELD, 6)
    retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 7)
    retvaltype = Cmd.PutText(" \\\", COMMENT_FIELD, 8)
    retvaltype = Cmd.PutText("  \\\", COMMENT_FIELD, 9)
    Cmd.ReDraw
    End If
    '------------------------------
    If dlg1.CheckBox20 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("  ///", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(" ///", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("///", COMMENT_FIELD, 3)
    retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 4)
    retvaltype = Cmd.PutText(" \\\", COMMENT_FIELD, 5)
    retvaltype = Cmd.PutText("  \\\", COMMENT_FIELD, 6)
    retvaltype = Cmd.PutText("  ///", COMMENT_FIELD, 7)
    retvaltype = Cmd.PutText(" ///", COMMENT_FIELD, 8)
    retvaltype = Cmd.PutText("///", COMMENT_FIELD, 9)
    Cmd.ReDraw
    End If
    '------------------------------
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  6. #6
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default

    Code:
    
    
    '- - - - CUSTOM $$ DOCUMENT COMMENT ------------------------------
    '     handling:
    Dim customstr13 As String
    customstr13 = dlg1.EditBox13
    Dim lenstr13 As Integer
    lenstr13 = Len(dlg1.EditBox13)
    
    Dim customstr14 As String
    customstr14 = dlg1.EditBox14
    Dim lenstr14 As Integer
    lenstr14 = Len(dlg1.EditBox14)
    
    Dim customstr15 As String
    customstr15 = dlg1.EditBox15
    Dim lenstr15 As Integer
    lenstr15 = Len(dlg1.EditBox15)
    
    Dim customstr16 As String
    customstr16 = dlg1.EditBox16
    Dim lenstr16 As Integer
    lenstr16 = Len(dlg1.EditBox16)
    
    Dim customstr17 As String
    customstr17 = dlg1.EditBox17
    Dim lenstr17 As Integer
    lenstr17 = Len(dlg1.EditBox17)
    
    Dim customstr18 As String
    customstr18 = dlg1.EditBox18
    Dim lenstr18 As Integer
    lenstr18 = Len(dlg1.EditBox18)
    
    Dim customstr19 As String
    customstr19 = dlg1.EditBox19
    Dim lenstr19 As Integer
    lenstr19 = Len(dlg1.EditBox19)
    
    Dim customstr20 As String
    customstr20 = dlg1.EditBox20
    Dim lenstr20 As Integer
    lenstr20 = Len(dlg1.EditBox20)
    
    Dim customstr21 As String
    customstr21 = dlg1.EditBox21
    Dim lenstr21 As Integer
    lenstr21 = Len(dlg1.EditBox21)
    
    Dim customstrE36 As String
    customstrE36 = dlg1.EditBoxE36
    Dim lenstrE36 As Integer
    lenstrE36 = Len(dlg1.EditBoxE36)
    
    
    '- - - - CUSTOM $$ DOCUMENT COMMENT, Setup Instructions  ------------------------------
    If dlg1.CheckBoxE46 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    
     If dlg1.CheckBoxE46 = 1  Then
    retvaltype = Cmd.PutText("------------ Setup Instructions ----------------------------------------------------------------", COMMENT_FIELD, 1)
     End If
    
     If lenstr13 = 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 3)
     End If
    
     If lenstr13 > 0 Then
     retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 2)
     End If
    
     If lenstr14 = 0 And lenstr13 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 3)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 4)
     End If
    
     If lenstr14 > 0 Then
     retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 3)
     End If
    
     If lenstr15 = 0 And lenstr14 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 4)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 5)
     End If
    
     If lenstr15 > 0 Then
     retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 4)
     End If
    
     If lenstr16 = 0 And lenstr15 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 5)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 6)
     End If
    
     If lenstr16 > 0 Then
     retvaltype = Cmd.PutText(customstr16, COMMENT_FIELD, 5)
     End If
    
     If lenstr17 = 0 And lenstr16 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 6)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 7)
     End If
    
     If lenstr17 > 0 Then
     retvaltype = Cmd.PutText(customstr17, COMMENT_FIELD, 6)
     End If
    
     If lenstr18 = 0 And lenstr17 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 7)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 8)
     End If
    
     If lenstr18 > 0 Then
     retvaltype = Cmd.PutText(customstr18, COMMENT_FIELD, 7)
     End If
    
     If lenstr19 = 0 And lenstr18 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 8)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 9)
     End If
    
     If lenstr19 > 0 Then
     retvaltype = Cmd.PutText(customstr19, COMMENT_FIELD, 8)
     End If
    
     If lenstr20 = 0 And lenstr19 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 9)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 10)
     End If
    
     If lenstr20 > 0 Then
     retvaltype = Cmd.PutText(customstr20, COMMENT_FIELD, 9)
     End If
    
     If lenstr21 = 0 And lenstr20 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 10)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 11)
     End If
    
     If lenstr21 > 0 Then
     retvaltype = Cmd.PutText(customstr21, COMMENT_FIELD, 10)
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 11)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 12)
     End If
    
     End If
    
    
    '- - - - CUSTOM $$ DOCUMENT COMMENT, Program Revisions  ------------------------------
    If dlg1.CheckBoxE36 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("------------ Program Revision Record ----------------------------------------------------------------", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("Created by "+customstrE36, COMMENT_FIELD, 2)
    
     If lenstr13 = 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 3)
     End If
    
     If lenstr13 > 0 Then
     retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 2)
     End If
    
     If lenstr14 = 0 And lenstr13 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 3)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 4)
     End If
    
     If lenstr14 > 0 Then
     retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 3)
     End If
    
     If lenstr15 = 0 And lenstr14 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 4)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 5)
     End If
    
     If lenstr15 > 0 Then
     retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 4)
     End If
    
     If lenstr16 = 0 And lenstr15 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 5)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 6)
     End If
    
     If lenstr16 > 0 Then
     retvaltype = Cmd.PutText(customstr16, COMMENT_FIELD, 5)
     End If
    
     If lenstr17 = 0 And lenstr16 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 6)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 7)
     End If
    
     If lenstr17 > 0 Then
     retvaltype = Cmd.PutText(customstr17, COMMENT_FIELD, 6)
     End If
    
     If lenstr18 = 0 And lenstr17 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 7)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 8)
     End If
    
     If lenstr18 > 0 Then
     retvaltype = Cmd.PutText(customstr18, COMMENT_FIELD, 7)
     End If
    
     If lenstr19 = 0 And lenstr18 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 8)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 9)
     End If
    
     If lenstr19 > 0 Then
     retvaltype = Cmd.PutText(customstr19, COMMENT_FIELD, 8)
     End If
    
     If lenstr20 = 0 And lenstr19 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 9)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 10)
     End If
    
     If lenstr20 > 0 Then
     retvaltype = Cmd.PutText(customstr20, COMMENT_FIELD, 9)
     End If
    
     If lenstr21 = 0 And lenstr20 > 0 Then
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 10)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 11)
     End If
    
     If lenstr21 > 0 Then
     retvaltype = Cmd.PutText(customstr21, COMMENT_FIELD, 10)
     retvaltype = Cmd.PutText("    ", COMMENT_FIELD, 11)
    retvaltype = Cmd.PutText("----------------------------------------------------------------------------", COMMENT_FIELD, 12)
     End If
    
     End If
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  7. #7
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default

    Code:
    
    '- - - - CUSTOM $$ DOCUMENT COMMENT, no options except "NOTE:" ------------------------------
    If lenstr13 > 0 And dlg1.CheckBoxE36 = 0 And dlg1.CheckBoxE46 = 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    
     If dlg1.Checkbox7071 = 1 Then
     retvaltype = Cmd.PutText("NOTE: " + customstr13, COMMENT_FIELD, 1)
     End If
    
     If dlg1.Checkbox7071 = 0 And dlg1.CheckBoxE36 = 0 And dlg1.CheckBoxE46 = 0 Then
     retvaltype = Cmd.PutText(customstr13, COMMENT_FIELD, 1)
     End If
    
     If lenstr14 > 0 Then
     retvaltype = Cmd.PutText(customstr14, COMMENT_FIELD, 2)
     End If
    
     If lenstr15 > 0 Then
     retvaltype = Cmd.PutText(customstr15, COMMENT_FIELD, 3)
     End If
    
     If lenstr16 > 0 Then
     retvaltype = Cmd.PutText(customstr16, COMMENT_FIELD, 4)
     End If
    
     If lenstr17 > 0 Then
     retvaltype = Cmd.PutText(customstr17, COMMENT_FIELD, 5)
     End If
    
     If lenstr18 > 0 Then
     retvaltype = Cmd.PutText(customstr18, COMMENT_FIELD, 6)
     End If
    
     If lenstr19 > 0 Then
     retvaltype = Cmd.PutText(customstr19, COMMENT_FIELD, 7)
     End If
    
     If lenstr20 > 0 Then
     retvaltype = Cmd.PutText(customstr20, COMMENT_FIELD, 8)
     End If
    
     If lenstr21 > 0 Then
     retvaltype = Cmd.PutText(customstr21, COMMENT_FIELD, 9)
     End If
    
         If dlg1.Checkbox7072 = 1 Then
          Open "C:\TEMP\NEWCANNED.txt" For Output As #1
          print #1, customstr13
    
           If lenstr14 > 0 Then
           print #1, customstr14
           End If
    
           If lenstr15 > 0 Then
           print #1, customstr15
           End If
    
           If lenstr16 > 0 Then
           print #1, customstr16
           End If
    
           If lenstr17 > 0 Then
           print #1, customstr17
           End If
    
           If lenstr18 > 0 Then
           print #1, customstr18
           End If
    
           If lenstr19 > 0 Then
           print #1, customstr19
           End If
    
           If lenstr20 > 0 Then
           print #1, customstr20
           End If
    
           If lenstr21 > 0 Then
           print #1, customstr21
           End If
    
          Close #1
        End If
    
    Cmd.ReDraw
    End If
    
    
    '''''''''''' NEW CANNED COMMENT !$%%$^&#*^@%^!$%~%%^@^&^@$&*()_$*~!%!^% '''''''''''
          If dlg1.Checkbox7073 = 1 Then
    Dim Line1 As String
    Dim Line2 As String
    Dim Line3 As String
    Dim Line4 As String
    Dim Line5 As String
    Dim Line6 As String
    Dim Line7 As String
    Dim Line8 As String
    Dim Line9 As String
    
          Open "C:\TEMP\NEWCANNED.txt" For Input As #1
          Line Input #1, Line1
          Line Input #1, Line2
          Line Input #1, Line3
          Line Input #1, Line4
          Line Input #1, Line5
          Line Input #1, Line6
          Line Input #1, Line7
          Line Input #1, Line8
          Line Input #1, Line9
          Close #1
    
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
     retvaltype = Cmd.PutText(Line1, COMMENT_FIELD, 1)
     retvaltype = Cmd.PutText(Line2, COMMENT_FIELD, 2)
     retvaltype = Cmd.PutText(Line3, COMMENT_FIELD, 3)
     retvaltype = Cmd.PutText(Line4, COMMENT_FIELD, 4)
     retvaltype = Cmd.PutText(Line5, COMMENT_FIELD, 5)
     retvaltype = Cmd.PutText(Line6, COMMENT_FIELD, 6)
     retvaltype = Cmd.PutText(Line7, COMMENT_FIELD, 7)
     retvaltype = Cmd.PutText(Line8, COMMENT_FIELD, 8)
     retvaltype = Cmd.PutText(Line9, COMMENT_FIELD, 9)
    End If
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  8. #8
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default

    Code:
    
    '- - - - CUSTOM OPERATOR COMMENTS  ------------------------------
    '         HANDLING
    Dim customstr23 As String
    customstr23 = dlg1.EditBox23
    Dim lenstr23 As Integer
    lenstr23 = Len(dlg1.EditBox23)
    
    Dim customstr24 As String
    customstr24 = dlg1.EditBox24
    Dim lenstr24 As Integer
    lenstr24 = Len(dlg1.EditBox24)
    
    Dim customstr25 As String
    customstr25 = dlg1.EditBox25
    Dim lenstr25 As Integer
    lenstr25 = Len(dlg1.EditBox25)
    
    Dim customstr26 As String
    customstr26 = dlg1.EditBox26
    Dim lenstr26 As Integer
    lenstr26 = Len(dlg1.EditBox26)
    
    Dim customstr27 As String
    customstr27 = dlg1.EditBox27
    Dim lenstr27 As Integer
    lenstr27 = Len(dlg1.EditBox27)
    
    Dim customstr28 As String
    customstr28 = dlg1.EditBox28
    Dim lenstr28 As Integer
    lenstr28 = Len(dlg1.EditBox28)
    
    Dim customstr29 As String
    customstr29 = dlg1.EditBox29
    Dim lenstr29 As Integer
    lenstr29 = Len(dlg1.EditBox29)
    
    
    ' - - - - OPERATOR COMMENT:  USUAL CHECKBOX -----------
    If lenstr23 > 0 And dlg1.CheckBox2327 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
    
    retvaltype = Cmd.PutText("CLICK OK, THEN:", COMMENT_FIELD, 1)
    
    retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 2)
    
     If lenstr24 > 0 Then
     retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 3)
     End If
    
     If lenstr25 > 0 Then
     retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 4)
     End If
    
     If lenstr26 > 0 Then
     retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 5)
     End If
    
     If lenstr27 > 0 Then
     retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 6)
     End If
    
     If lenstr28 > 0 Then
     retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 7)
     End If
    
    Cmd.ReDraw
    End If
    
    ' - - - - OPERATOR COMMENT:  ALTERNATE CHECKBOX -----------
    
    If lenstr23 > 0 And dlg1.CheckBox2328 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
    
    retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 1)
    
     If lenstr24 = 0 Then
     retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 2)
     End If
     If lenstr24 > 0 Then
     retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
     End If
    
     If lenstr24 > 0 And lenstr25 = 0 Then
     retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 3)
     End If
     If lenstr25 > 0 Then
     retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
     End If
    
     If lenstr25 > 0 And lenstr26 = 0 Then
     retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 4)
     End If
     If lenstr26 > 0 Then
     retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
     End If
    
     If lenstr26 > 0 And lenstr27 = 0 Then
     retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 5)
     End If
     If lenstr27 > 0 Then
     retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
     End If
    
     If lenstr27 > 0 And lenstr28 = 0 Then
     retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 6)
     End If
     If lenstr28 > 0 Then
     retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
     retvaltype = Cmd.PutText("THEN CLICK OK.", COMMENT_FIELD, 7)
     End If
    
    Cmd.ReDraw
    End If
    
    ' - - - - OPERATOR COMMENT:  NO CHECKBOX -----------
    
    If lenstr23 > 0 And dlg1.CheckBox2328 = 0 And dlg1.CheckBox2327 = 0 And dlg1.CheckBox2329 = 0 And dlg1.CheckBox2330 = 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("OPER", COMMENT_TYPE, 0)
    
    retvaltype = Cmd.PutText(customstr23, COMMENT_FIELD, 1)
    
     If lenstr24 > 0 Then
     retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
     End If
    
     If lenstr25 > 0 Then
     retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
     End If
    
     If lenstr26 > 0 Then
     retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
     End If
    
     If lenstr27 > 0 Then
     retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
     End If
    
     If lenstr28 > 0 Then
     retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
     End If
    Cmd.ReDraw
    End If
    
    
    
    
    
    ' - - - - OPERATOR COMMENT:  YES/NO  -----------
    If lenstr23 > 0 And dlg1.CheckBox2329 = 1 And lenstr29 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText (customstr29, ID, 0)
    retvaltype = Cmd.SetToggleString (5, COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText (customstr23, COMMENT_FIELD, 1)
    
     If lenstr24 > 0 Then
     retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
     End If
    
     If lenstr25 > 0 Then
     retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
     End If
    
     If lenstr26 > 0 Then
     retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
     End If
    
     If lenstr27 > 0 Then
     retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
     End If
    
     If lenstr28 > 0 Then
     retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
     End If
    
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, DISPLAY_TYPE, 0)
    retvaltype = Cmd.PutText ("NO", TIME_ARG, 0)
    retvaltype = Cmd.PutText ("0", T_VALUE, 0)
    End If
    
    
    
    ' - - - - OPERATOR COMMENT:  INPUT  -----------
    If lenstr23 > 0 And dlg1.CheckBox2330 = 1 And lenstr29 > 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText (customstr29, ID, 0)
    retvaltype = Cmd.SetToggleString (3, COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText (customstr23, COMMENT_FIELD, 1)
    
     If lenstr24 > 0 Then
     retvaltype = Cmd.PutText(customstr24, COMMENT_FIELD, 2)
     End If
    
     If lenstr25 > 0 Then
     retvaltype = Cmd.PutText(customstr25, COMMENT_FIELD, 3)
     End If
    
     If lenstr26 > 0 Then
     retvaltype = Cmd.PutText(customstr26, COMMENT_FIELD, 4)
     End If
    
     If lenstr27 > 0 Then
     retvaltype = Cmd.PutText(customstr27, COMMENT_FIELD, 5)
     End If
    
     If lenstr28 > 0 Then
     retvaltype = Cmd.PutText(customstr28, COMMENT_FIELD, 6)
     End If
    
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, DISPLAY_TYPE, 0)
    retvaltype = Cmd.PutText ("NO", TIME_ARG, 0)
    retvaltype = Cmd.PutText ("0", T_VALUE, 0)
    End If
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  9. #9
    Moderator
    • Additional Information
      • Years CMM Experience:
      • 1000
      • Software Version:
      • All
      • Machine Type:
      • All
      • Location:
      • Hexagon, Dallas, Texas
      • Job Function:
      • Applications Engineer
    Josh Carpenter's Avatar
    Join Date
    Jun 2011
    Location
    Hexagon, Dallas, Texas
    Posts
    876

    Default

    Code:
    
    '- - - - - REPORT COMMENT handling --------------------------------------
    
    Dim customstr91 As String
    Dim customstr92 As String
    Dim customstr93 As String
    Dim customstr94 As String
    Dim customstr95 As String
    Dim lenstr91 As Integer
    Dim lenstr92 As Integer
    Dim lenstr93 As Integer
    Dim lenstr94 As Integer
    Dim lenstr95 As Integer
    
    customstr95 = dlg1.EditBox95
    lenstr95 = Len(dlg1.EditBox95)
    
    If lenstr95 > 0 Then
     customstr91 = dlg1.EditBox95 + "   " + dlg1.EditBox91 + "   " + dlg1.EditBox95
     lenstr91 = Len(dlg1.EditBox91)
    
     customstr92 = "       " + dlg1.EditBox92
     lenstr92 = Len(dlg1.EditBox92)
    
     customstr93 = "       " + dlg1.EditBox93
     lenstr93 = Len(dlg1.EditBox93)
    
    End If
    
    If lenstr95 = 0 Then
     customstr91 = dlg1.EditBox91
     lenstr91 = Len(dlg1.EditBox91)
    
     customstr92 = dlg1.EditBox92
     lenstr92 = Len(dlg1.EditBox92)
    
     customstr93 = dlg1.EditBox93
     lenstr93 = Len(dlg1.EditBox93)
    
    
    End If
    
    '- - - - REPORT COMMENT, NO SPACELINES -----------
    
    If lenstr91 > 0 And dlg1.CheckBox9193 = 0 And dlg1.CheckBox9194 = 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 1)
    
     If lenstr92 > 0 Then
     retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 2)
     End If
    
     If lenstr93 > 0 Then
     retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 3)
     End If
    
     If lenstr94 > 0 Then
     retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 4)
     End If
    
    Cmd.ReDraw
    End If
    
    
    
    
    '- - - - REPORT COMMENT, SPACELINE BEFORE ONLY -----------
    
    If lenstr91 > 0 And dlg1.CheckBox9193 = 1 And dlg1.CheckBox9194 = 0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 2)
    
     If lenstr92 > 0 Then
     retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 3)
     End If
    
     If lenstr93 > 0 Then
     retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 4)
     End If
    
     If lenstr94 > 0 Then
     retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 5)
     End If
    
    Cmd.ReDraw
    End If
    
    
    '- - - - REPORT COMMENT, SPACELINE AFTER ONLY -----------
    
    If lenstr91 > 0 And dlg1.CheckBox9193 = 0 And dlg1.CheckBox9194 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    
    retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 1)
    
     If lenstr92 = 0 Then
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 2)
     End If
    
     If lenstr92 > 0 Then
     retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 2)
     End If
     If lenstr92 > 0 And lenstr93 = 0 Then
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 3)
     End If
    
     If lenstr93 > 0 Then
     retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 3)
     End If
     If lenstr93 > 0 And lenstr94 = 0 Then
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 4)
     End If
    
     If lenstr94 > 0 Then
     retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 4)
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 5)
     End If
    
    Cmd.ReDraw
    End If
    
    
    '- - - - REPORT COMMENT, SPACELINE BEFORE AND AFTER -----------
    
    If lenstr91 > 0 And dlg1.CheckBox9193 = 1 And dlg1.CheckBox9194 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 1)
    
    retvaltype = Cmd.PutText(customstr91, COMMENT_FIELD, 2)
    
     If lenstr92 = 0 Then
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 3)
     End If
    
     If lenstr92 > 0 Then
     retvaltype = Cmd.PutText(customstr92, COMMENT_FIELD, 3)
     End If
     If lenstr92 > 0 And lenstr93 = 0 Then
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 4)
     End If
    
     If lenstr93 > 0 Then
     retvaltype = Cmd.PutText(customstr93, COMMENT_FIELD, 4)
     End If
     If lenstr93 > 0 And lenstr94 = 0 Then
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 5)
     End If
    
     If lenstr94 > 0 Then
     retvaltype = Cmd.PutText(customstr94, COMMENT_FIELD, 5)
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 6)
     End If
    
    Cmd.ReDraw
    End If
    
    
    
    
    '- - - - REPORT COMMENT, JUST ONE BLANK SPACELINE -----------
    If dlg1.CheckBox9195 = 1 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
     retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
     retvaltype = Cmd.PutText("       ", COMMENT_FIELD, 1)
    End If
    
    
    
    
    
    
    
    '- - - - OP AND PAGE #, PLUS FORM FEED ------------------------------
    Dim customstr201 As String
    customstr201 = dlg1.EditBox201
    Dim lenstr201 As Integer
    lenstr201 = Len(dlg1.EditBox201)
    
    Dim customstr202 As String
    customstr202 = "PAGE " + dlg1.EditBox202
    Dim lenstr202 As Integer
    lenstr202 = Len(dlg1.EditBox202)
    
    Dim customstr203 As String
    
    If lenstr201 > 0 And lenstr202 >0 Then
    customstr203 = "                                 " + customstr202 + "   " + customstr201
    End IF
    
    If lenstr201 > 0 And lenstr202 =0 Then
    customstr203 = "                                 " + customstr201
    End IF
    
    If lenstr201 = 0 And lenstr202 >0 Then
    customstr203 = "                                 " + customstr202
    End IF
    
    If lenstr201 > 0 Or lenstr202 >0 Then
       If dlg1.CheckBox133 = 1 Then
       Set Cmd = Cmds.Add(SET_COMMENT, True)
       retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
       retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
       retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
       retvaltype = Cmd.PutText("\\", COMMENT_FIELD, 2)
       retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 3)
    
       Set Cmd = Cmds.Add(PRINT_FORM_FEED, TRUE)
    
       Set Cmd = Cmds.Add(SET_COMMENT, True)
       retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
       retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
       retvaltype = Cmd.PutText("///", COMMENT_FIELD, 1)
       retvaltype = Cmd.PutText("//", COMMENT_FIELD, 2)
       retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
       End If
    
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("REPT", COMMENT_TYPE, 0)
    retvaltype = Cmd.PutText("   ", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("-------------------------------------------------------------------------------------------------------", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText(customstr203, COMMENT_FIELD, 3)
    retvaltype = Cmd.PutText("-------------------------------------------------------------------------------------------------------", COMMENT_FIELD, 4)
    Cmd.ReDraw
    End If
    
    
    If dlg1.CheckBox133 = 1 And lenstr201=0 Then
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("\", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("\\", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("\\\", COMMENT_FIELD, 3)
    Cmd.ReDraw
    
    Set Cmd = Cmds.Add(PRINT_FORM_FEED, TRUE)
    
    Set Cmd = Cmds.Add(SET_COMMENT, True)
    retvaltype = Cmd.PutText("$$", COMMENT_TYPE, 0)
    retvaltype = Cmd.SetToggleString (1, OUTPUT_TYPE, 0)
    retvaltype = Cmd.PutText("///", COMMENT_FIELD, 1)
    retvaltype = Cmd.PutText("//", COMMENT_FIELD, 2)
    retvaltype = Cmd.PutText("/", COMMENT_FIELD, 3)
    Cmd.ReDraw
    End If
    
    
    '~~~~~~~~~~~~~~~~~~~~~~~~~~ END OF INPUTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Repeater = Repeater-1
    Loop
    
    
    
    End Sub
    That's all of it.
    "You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete." - B. Fuller

  10. #10
    PC-DMIS Guru
    • Additional Information
      • Years CMM Experience:
      • Since 1994
      • Software Version:
      • PC-DMIS CAD++ 2014.1
      • Machine Type:
      • CEJ12C, CEJ12000
      • Location:
      • Sweden
      • Job Function:
      • Quality tech., CMM programmer/operator
    vpt.se's Avatar
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    4,867

    Default

    Lovely!

    <geek>
    It reminds me of the ASCII-art in some IRC scripts...
    </geek>
    PC-DMIS CAD++ 2o14.1

Similar Threads

  1. Share Scripts at the Custom Script Repository
    By JaredHess in forum PC-DMIS Code Samples
    Replies: 3
    Last Post: 07-29-2013, 12:08 AM
  2. Reporting a input comment on custom report
    By Duane Silva in forum PC-DMIS for CMMs
    Replies: 2
    Last Post: 08-17-2011, 07:21 PM
  3. Auto Comment Script
    By apex777 in forum PC-DMIS Code Samples
    Replies: 0
    Last Post: 07-16-2009, 10:48 AM
  4. Machine upgraded
    By CSClark in forum PC-DMIS for CMMs
    Replies: 9
    Last Post: 05-02-2008, 07:27 PM
  5. UPGRADED FROM 3.5 to 4.2
    By mburns in forum PC-DMIS for CMMs
    Replies: 4
    Last Post: 07-23-2007, 01:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •