<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Event Malfuction Within Assemblies in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-event-malfuction-within-assemblies/m-p/11779903#M149463</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Set cvAppEvents to be launchable as an application event&lt;/P&gt;&lt;P&gt;Dim cvAppEvents As ApplicationEvents = ThisApplication.ApplicationEvents&lt;/P&gt;&lt;P&gt;'When any document is activated, trigger the subroutine&lt;/P&gt;&lt;P&gt;AddHandler cvAppEvents.onActivateDocument, AddressOf cvLaunchMacroTab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2023 21:36:59 GMT</pubDate>
    <dc:creator>gorhanr</dc:creator>
    <dc:date>2023-02-24T21:36:59Z</dc:date>
    <item>
      <title>Custom Event Malfuction Within Assemblies</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-event-malfuction-within-assemblies/m-p/11779903#M149463</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Set cvAppEvents to be launchable as an application event&lt;/P&gt;&lt;P&gt;Dim cvAppEvents As ApplicationEvents = ThisApplication.ApplicationEvents&lt;/P&gt;&lt;P&gt;'When any document is activated, trigger the subroutine&lt;/P&gt;&lt;P&gt;AddHandler cvAppEvents.onActivateDocument, AddressOf cvLaunchMacroTab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 21:36:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-event-malfuction-within-assemblies/m-p/11779903#M149463</guid>
      <dc:creator>gorhanr</dc:creator>
      <dc:date>2023-02-24T21:36:59Z</dc:date>
    </item>
  </channel>
</rss>

