hexagon logo

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...........
  • VBS (Visual Basic Script) or a PC-DMIS script?
  • No error message, Simply software gets hang........... if I Unmark those script file, software executes the program completely..........
  • Maybe the path to the .bas file is incorrect?
  • I deleted the existing file inside the program and re-inserted again, but still it happens.........
  • Does it hang on the script in the beginning or the end or both?
  • 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 “.

    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
    
  • 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.
  • Looks like the PC-Dmis application library has been disabled. Try loading the PC-DMIS VBA library again.