hexagon logo

problems running script

Has anyone else tried to run this script from the Wilcox site "tracesheet.bas"? I added all the assignments per the instructions and I get no output to the variables at all. If I'm correct should I not see the selections from the menu in the assignments in my pcdims program?



Thanks Bill



PCDMIS 3.7 MR3
PCDMIS 4.3 MR1
Parents
  • Ok, never having worked with this script and trying to avoid Cypress like the plague I can only make an assumtion here but here it is.

    I would guess that the Button = Dialog (Dlg1) line will return some sort of value for whichever button you pressed in the dialog box. You would need to test this to see what that value is depending on which button you pressed and then you can set a condition to pass some value back to your program based on that.

    I would imagine something like:

     
    If Button = 0 then   [COLOR=red](aparently 0 is the value for the cancelbutton according to an example I found in the help files...)[/COLOR] 
      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
     
      For Each Cmd In Cmds
          If Cmd.Type = ASSIGNMENT Then
              If Cmd.GetText(DEST_EXPR, 0) = "BUTTON" Then
                bln = Cmd.PutText("Cancel", SRC_EXPR, 0)
                Cmd.ReDraw
           End If
      Next Cmd
     
      Exit Sub
     
    End If
     
    


    This is only a guess and I haven't had time to try any of this out so take it with a grain of salt...
Reply
  • Ok, never having worked with this script and trying to avoid Cypress like the plague I can only make an assumtion here but here it is.

    I would guess that the Button = Dialog (Dlg1) line will return some sort of value for whichever button you pressed in the dialog box. You would need to test this to see what that value is depending on which button you pressed and then you can set a condition to pass some value back to your program based on that.

    I would imagine something like:

     
    If Button = 0 then   [COLOR=red](aparently 0 is the value for the cancelbutton according to an example I found in the help files...)[/COLOR] 
      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
     
      For Each Cmd In Cmds
          If Cmd.Type = ASSIGNMENT Then
              If Cmd.GetText(DEST_EXPR, 0) = "BUTTON" Then
                bln = Cmd.PutText("Cancel", SRC_EXPR, 0)
                Cmd.ReDraw
           End If
      Next Cmd
     
      Exit Sub
     
    End If
     
    


    This is only a guess and I haven't had time to try any of this out so take it with a grain of salt...
Children
No Data