如果您知道先前事件,则可以编写代码,在当前规则内创建该事件并访问数据。
编码有以下限制:
- 如果使用了错误的类型,则会发生运行时错误。
- 这些旧事件中的信息是陈旧的。如果精炼操作创建了一些页面,在精炼处理之前发生的事件不会有访问这些页面的权限。
' Casting the very first event in this rule to its type
Dim myRootEvent As Creo.PWS.Automation.GenericDataModel.GenericUserStartEvent =
triggerEvent.RootEvent
' Casting the previous event in this rule to its type
Dim myRefineOkEvent As CreoCreo.PWS.Automation.PrinergyDataModel.InputFileRefinedOk =
triggerEvent.Previous