hexagon logo

Exectuting multiple script commands in PCD program from a script.

I would like to execute a handful of script commands in a PCDMIS program from a script (I want to use a button). The following code works one time on a fresh part load. It does not run the script more than once. It does find the script and continue to cycle, just does not actually run any additional calls.

Thanks.

Sub main()
TestIt
End Sub
'=================================
Sub TestIt()
Dim DmisApp As Object
Dim DmisPart As Object
Dim DmisCommands As Object
Dim DmisCommand As Object

Set DmisApp = CreateObject("PCDLRN.Application")
Set DmisPart = DmisApp.ActivePartProgram
Set DmisCommands = DmisPart.Commands

For Each DmisCommand In DmisCommands
If DmisCommand.Type =12346 And DmisCommand.ID = "CS2" Then
MsgBox "yes"
DmisCommand.Execute
DmisCommands.InsertionPointAfter DmisCommand

End If
Next DmisCommand
Set DmisApp = Nothing
Set DmisPart = Nothing
Set DmisCommands = Nothing
Set DmisCommand = Nothing
End Sub
Parents
  • I tried your script in 2014.1 and see the same thing. I have no idea what's missing - it's like PC-DMIS thinks it is unnecessary to run the command again. But I can't find anything in the TLB that is obvious to call for a 'clear all executed'...

    BTW, you can use the constant BASIC_SCRIPT instead of the magic number 12346.
Reply
  • I tried your script in 2014.1 and see the same thing. I have no idea what's missing - it's like PC-DMIS thinks it is unnecessary to run the command again. But I can't find anything in the TLB that is obvious to call for a 'clear all executed'...

    BTW, you can use the constant BASIC_SCRIPT instead of the magic number 12346.
Children
No Data