hexagon logo

How to use AppEvents?

Hello all After searching the forums and spending time trying to figure this out I came up short. I am trying to run code as soon as a DIMENSION command is created via the AppEvents automation in Excel VBA.for example
Private Sub AppEvents_OnAddObject(ByVal PartProg As PCDLRN.IPartProgram, ByVal DimensionCommand As Command)
    ' Event subroutine. This activates when a dimension command is fired.
MsgBox "Do something"
End Sub

At the moment it's triggered by ANY new item inserted in PcDmis no matter the type. How do you get it to trigger for SPECIFIC commands ONLY?

Any input is welcomed?
Thanks,
Kp61dude!
Parents
  • The AppEvents_OnAddObject is doing exactly was designed to do, trigger an event whenever something is added to the PC-Dmis program. If you're interested in capturing Dimension data after the Dimension object was executed during part measurement you may want to look at the DmisLib code and PcdmisMenu code in my thread. The DmisLib captures the Dimension Data of each Dimension command after it is executed and passes it to the PcdmisMenu application where it is written into the Main window textboxes.
Reply
  • The AppEvents_OnAddObject is doing exactly was designed to do, trigger an event whenever something is added to the PC-Dmis program. If you're interested in capturing Dimension data after the Dimension object was executed during part measurement you may want to look at the DmisLib code and PcdmisMenu code in my thread. The DmisLib captures the Dimension Data of each Dimension command after it is executed and passes it to the PcdmisMenu application where it is written into the Main window textboxes.
Children
No Data