Unable to execute the script......

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to execute the script......

    All my program is having vb-script at the begining of the program for Operator Input, and end of the program to Create the folder for saving the report.
    and I'm using this same script for last 2 years.


    Past two days i'm facing a issue, that PC-DMIS gets crash while executing the Script file.....

    I'M using PC-DMIS CAD++ 2019 R2 (SP2), Yesterday i updated it to (SP3), but still the problem continues...........
    Last edited by Thiyagu_Raj; 02-25-2020, 01:05 AM.

  • #2
    VBS (Visual Basic Script) or a PC-DMIS script?
    PC-DMIS CAD++ 2o19 R1 SP11

    Comment


    • Thiyagu_Raj
      Thiyagu_Raj commented
      Editing a comment
      Basic Script (.bas File).....

  • #3
    What error message are you getting?
    PC-DMIS CAD++ 2o19 R1 SP11

    Comment


    • #4
      No error message, Simply software gets hang........... if I Unmark those script file, software executes the program completely..........

      Comment


      • #5
        Maybe the path to the .bas file is incorrect?

        B&S CHAMELEON/PCDMIS CAD++ V2011

        There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

        sigpic

        Comment


        • Thiyagu_Raj
          Thiyagu_Raj commented
          Editing a comment
          I deleted the existing file inside the program and re-inserted again, but still it happens.........

      • #6
        Does it hang on the script in the beginning or the end or both?
        PC-DMIS CAD++ 2o19 R1 SP11

        Comment


        • #7
          Today i tried the same script with 2018 R2.
          I hope that, I found what is the error,

          Initially I just inserted speed parameters into new program and exported it as basic script.
          Then I inserted & compiled the same exported file into the program, until this everything goes fine.


          When I try to run the script, I’m getting the error “Error on line: 7 - Class not Registered “.

          Code:
          Dim DmisApp As Object
          Dim DmisPart As Object
          Dim DmisCommands As Object
          Dim DmisCommand As Object
          
          Sub Part1
          Set DmisApp = CreateObject("PCDLRN.Application")
          Set DmisPart = DmisApp.ActivePartProgram
          Set DmisCommands = DmisPart.Commands
          CommandCount = DmisCommands.Count
          Set DmisCommand = DmisCommands.Item(CommandCount)
          DmisCommands.InsertionPointAfter DmisCommand
          Set DmisCommand = DmisCommands.Add(START_ALIGN, True)
          DmisCommand.Marked = True
          ' Set Id = STARTUP
          retval = DmisCommand.PutText ("STARTUP", ID, 0)
          ' Set Reference Id Item 1 = USE_PART_SETUP
          retval = DmisCommand.PutText ("USE_PART_SETUP", REF_ID, 1)
          ' Set Alignment List = YES
          retval = DmisCommand.SetToggleString (2, ALIGN_LIST, 0)
          
          Set DmisCommand = DmisCommands.Add(END_ALIGN, True)
          DmisCommand.Marked = True
          
          Set DmisCommand = DmisCommands.Add(MAN_DCC_MODE, True)
          DmisCommand.Marked = True
          ' Set Mode = MANUAL
          retval = DmisCommand.SetToggleString (2, MODE_TYPE, 0)
          
          Set DmisCommand = DmisCommands.Add(DIMENSION_FORMAT, True)
          DmisCommand.Marked = True
          ' Set Dimension Text = TEXT
          retval = DmisCommand.SetToggleString (1, DIM_TEXT, 0)
          ' Set Dimension Text Options = OPTIONS
          retval = DmisCommand.SetToggleString (2, DIM_TEXT_OPTIONS, 0)
          ' Set Show Headings = HEADINGS
          retval = DmisCommand.SetToggleString (3, SHOW_HEADINGS, 0)
          ' Set Show Symbols = SYMBOLS
          retval = DmisCommand.SetToggleString (4, DEVIATION_SYMBOLS, 0)
          ' Set Standard Deviation =
          retval = DmisCommand.SetToggleString (7, STANDARD_DEVIATION, 0)
          ' Set Dimension Heading Item 1 = NOM
          retval = DmisCommand.SetToggleString (1, DIM_HEADING, 1)
          ' Set Dimension Heading Item 2 = TOL
          retval = DmisCommand.SetToggleString (2, DIM_HEADING, 2)
          ' Set Dimension Heading Item 3 = MEAS
          retval = DmisCommand.SetToggleString (3, DIM_HEADING, 3)
          ' Set Dimension Heading Item 4 = DEV
          retval = DmisCommand.SetToggleString (5, DIM_HEADING, 4)
          ' Set Dimension Heading Item 5 = OUTTOL
          retval = DmisCommand.SetToggleString (6, DIM_HEADING, 5)
          
          Set DmisCommand = DmisCommands.Add(GET_PROBE_DATA, True)
          DmisCommand.Marked = True
          ' Set Filename = TP20_2X30
          retval = DmisCommand.PutText ("TP20_2X30", FILE_NAME, 0)
          
          Set DmisCommand = DmisCommands.Add(SET_ACTIVE_TIP, True)
          DmisCommand.Marked = True
          ' Set Id = T1A0B0
          retval = DmisCommand.PutText ("T1A0B0", REF_ID, 0)
          ' Set Tip I = 0
          retval = DmisCommand.PutText ("0", TIP_I, 0)
          ' Set Tip J = 0
          retval = DmisCommand.PutText ("0", TIP_J, 0)
          ' Set Tip K = 1
          retval = DmisCommand.PutText ("1", TIP_K, 0)
          ' Set Theoretical Angle = 0
          retval = DmisCommand.PutText ("0", THEO_ANGLE, 0)
          
          Set DmisCommand = DmisCommands.Add(MOVE_SPEED, True)
          DmisCommand.Marked = True
          ' Set Move Speed = 100
          retval = DmisCommand.PutText ("100", F_MOVESPEED, 0)
          
          Set DmisCommand = DmisCommands.Add(TOUCH_SPEED, True)
          DmisCommand.Marked = True
          ' Set Touch Speed = 3
          retval = DmisCommand.PutText ("3", F_TOUCHSPEED, 0)
          
          Set DmisCommand = DmisCommands.Add(SCAN_SPEED, True)
          DmisCommand.Marked = True
          ' Set Scan Speed = 2
          retval = DmisCommand.PutText ("2", F_SCANSPEED, 0)
          
          End Sub
          
          Sub Main
          
          Part1
          
          DmisPart.RefreshPart
          End Sub
          Last edited by Thiyagu_Raj; 02-26-2020, 09:12 PM.

          Comment


          • #8
            So, this line is what is causing the current problem:

            Set DmisApp = CreateObject("PCDLRN.Application")
            - Run 2018 R2 as administrator and try again.
            - If it still doesn't work, check that you have read/write permissions for the Windows registry

            After installing a new version of PC-DMIS you should always start it as administrator at least once.
            PC-DMIS CAD++ 2o19 R1 SP11

            Comment


            • #9
              Looks like the PC-Dmis application library has been disabled. Try loading the PC-DMIS VBA library again.
              sigpic

              Comment


              • Thiyagu_Raj
                Thiyagu_Raj commented
                Editing a comment
                How to do this ?

            • #10
              https://docs.hexagonmi.com/pcdmis/20...r_Editors.html

              after you've done all that, i didn't see this line, I don't know if you need it anymore but try it:

              Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myapp As PCDLRN.Application myapp = CreateObject("PCDLRN.Application")

              it is a binding script.

              Last edited by Cumofo; 02-28-2020, 05:05 PM.
              sigpic

              Comment


              • #11
                This seems to be a PC-DMIS Basic script, not VBA/VBS/VB.
                PC-DMIS CAD++ 2o19 R1 SP11

                Comment

                Related Topics

                Collapse

                Working...
                X