Custom Event Malfuction Within Assemblies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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?