Custom Event Malfuction Within Assemblies

Custom Event Malfuction Within Assemblies

gorhanr
Observer Observer
177 Views
0 Replies
Message 1 of 1

Custom Event Malfuction Within Assemblies

gorhanr
Observer
Observer

Hi all,

 

I'm running a script that generates a custom "Macros" tab for users to launch iLogic scripts via VBA and I ran into a problem with opening a part from and open assembly where the default event triggers wouldn't launch the script. I worked around this by creating a local by using the script below:

 

'Set cvAppEvents to be launchable as an application event

Dim cvAppEvents As ApplicationEvents = ThisApplication.ApplicationEvents

'When any document is activated, trigger the subroutine

AddHandler cvAppEvents.onActivateDocument, AddressOf cvLaunchMacroTab

 

The problem I'm running into now is that this script seems to want to run the sub for EACH OCCURRENCE within the assembly, regardless of whether or not the assembly is being swapped to/from (when multiple items are open) which causes delays. Is there a way to get this event to run only once?

0 Likes
178 Views
0 Replies
Replies (0)