hexagon logo

Need help with scripting

This is my first attempt at script so please be kind.
What I want to do is to see what active part program Pc Gear has opened.
I have found a way to do this in Dmis but cannot find the gear application.
When I try I get - runtime error on line 9 – OLE automation server cannot create object.
I have tried Gear.application, PcDmisGear.application, Pc-dmis gear.application.
I looked at the windows task manager for its description with no help.
What I have

[B]Sub[/B][B] main[/B]
[B]  'Delare variable[/B]
[B]     Dim strFileName As String    [/B]
[B]     Dim ObjApp As Object[/B]
[B]     Dim ObjPart As Object[/B]
[B]     Dim StrDimID As String[/B]
 
  [B]' Line works For PC Dmis         Set ObjApp = CreateObject("pcdlrn.application")[/B]
[B]     Set ObjApp = CreateObject("[/B]Pc-dmis gear.application[B]")[/B]
[B]     Set ObjPart = ObjApp.ActivePartProgram         [/B]
  
[B]   'Build And assign file Name[/B]
[B]     strFileName = "C:\PCD output.txt"[/B]
[B]     Open strFileName For Output As #1[/B]
[B]              StrDimID = ObjPart [/B]
 
[B]   'Remove .prg [/B]
[B]   If len(StrDimID)>0 Then   [/B]
[B]        StrDimID = mid(StrDimID,1,len(StrDimID)-4)    [/B]
[B]   End If [/B]
 
[B]   'Write To file And save[/B]
[B]     Write #1, StrDimID[/B]
[B]            Close #1[/B]
[B]     MsgBox("File save complete")[/B]
[B]End[/B][B] Sub[/B]

I repeat my first attempt and what I have I picked up from everyone here and some help files.
The other would be PC Gear and Basic script is not compatible.
I do not have a script editor so any ideas would be helpful.

AL
  • I thought gear was similar to blade.
    i.e. they are not directly connected to pcdmis.
    you need bladerunner to automate pcdmis when using blade, so I presume there is something similar for gear.


    That is not a bad thought, but not entirely true. Bladerunner was written via automation to develop the programs to measure blades. It was actually first developed by Hexagon Applications, accessing the PC-DMIS Type Library for the objects. In the case of Gear, this is the tool to develop the part programs to measure the Gears. it was coded to use the same automation to develop the program and measure the Gear.

    So with that in mind, in the case of Blades, it would not be unlike trying to write some automation tool to work through BladeRunner, which is already using automation to access PC-DMIS.
  • That is not a bad thought, but not entirely true. Bladerunner was written via automation to develop the programs to measure blades. It was actually first developed by Hexagon Applications, accessing the PC-DMIS Type Library for the objects. In the case of Gear, this is the tool to develop the part programs to measure the Gears. it was coded to use the same automation to develop the program and measure the Gear.

    So with that in mind, in the case of Blades, it would not be unlike trying to write some automation tool to work through BladeRunner, which is already using automation to access PC-DMIS.


    So is that why scripts won't work when using BladeRunner, Don?



    Sent from my iPhone using Tapatalk