hexagon logo

2012 MR1 Error

I have a script which works fine on previous versions of PC Dmis, but is failing on 2012 MR1 with an OLE Automation error.
The line that fails is:
Set PCDMIS = CreateObject("PCDLRN.Application")

However given that I am executing the VB Script WITHIN the DMIS program I wonder if this is nescessary.
How else do I reference the ActivePartProgram without the above code?

The failure manifests itself with PCDMIS opening a window which says "the action cannot be completed because the other program is busy". "Switch to", etc..

Is this because I am in effect trying to create an object that is already open?
What does this not fail on earlier versions of PCDMIS?
Parents
  • I'm not sure why that doesn't work for you. Try this simple test script:

    Sub Main

    Dim App As Object
    Set App = CreateObject ("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram

    ' Test Part Name
    MsgBox Part.Name

    End Sub


    This worked for me in 2012 MR1. Also, you might have to have administrator privileges to run scripts. I can't remember.
Reply
  • I'm not sure why that doesn't work for you. Try this simple test script:

    Sub Main

    Dim App As Object
    Set App = CreateObject ("PCDLRN.Application")
    Dim Part As Object
    Set Part = App.ActivePartProgram

    ' Test Part Name
    MsgBox Part.Name

    End Sub


    This worked for me in 2012 MR1. Also, you might have to have administrator privileges to run scripts. I can't remember.
Children
No Data