<?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 Quick idea to run ilogic rule on view representation change in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/6902115#M70504</link>
    <description>&lt;P&gt;&lt;FONT size="3"&gt;Anyone got a quick brilliant idea to run a rule every time a view representation is changed??&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(it's a very complicated assembly with lots of sub-ass'y, iassembly and ilogic part talking to each other and i want to spare the user the need to open different view rep and run the rule for each of them.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2017 18:44:46 GMT</pubDate>
    <dc:creator>yvandelafontaine</dc:creator>
    <dc:date>2017-02-24T18:44:46Z</dc:date>
    <item>
      <title>Quick idea to run ilogic rule on view representation change</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/6902115#M70504</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;Anyone got a quick brilliant idea to run a rule every time a view representation is changed??&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(it's a very complicated assembly with lots of sub-ass'y, iassembly and ilogic part talking to each other and i want to spare the user the need to open different view rep and run the rule for each of them.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 18:44:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/6902115#M70504</guid>
      <dc:creator>yvandelafontaine</dc:creator>
      <dc:date>2017-02-24T18:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Quick idea to run ilogic rule on view representation change</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/6908641#M70538</link>
      <description>&lt;P&gt;HI yvandelafontaine,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The one way I can think of, to achieve this, is by using the RepresentationEvents.OnActivateDesignView Event.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a sample piece of code that may help you get started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy the below code into a code module.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oRepCls As cRepEvents ' Create a new cRepEvents object

Sub StartEvents()
    Set oRepCls = New cRepEvents
End Sub
 
Sub StopEvents()
    Set oRepCls = Nothing
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new class module called cRepEvents and copy below code into it, since VB only supports events within a class module&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Private WithEvents RepEvents As RepresentationEvents
Private Ilogicaddin As Object
 
Private Sub Class_Initialize()
    Set RepEvents = ThisApplication.RepresentationEvents
    Set Ilogicaddin = ThisApplication.ApplicationAddIns.ItemById("{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}").Automation ' Get ilogic addin to run the rule
End Sub
 
Private Sub Class_Terminate()
    Set RepEvents = Nothing
End Sub
 
Private Sub RepEvents_OnActivateDesignView(ByVal DocumentObject As Document, ByVal Representation As DesignViewRepresentation, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum)
    &lt;BR /&gt;    Ilogicaddin.RunRule DocumentObject, "Rule0" ' The rule name that needs to be executed
&lt;BR /&gt;End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sajith&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 11:08:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/6908641#M70538</guid>
      <dc:creator>sajith_subramanian</dc:creator>
      <dc:date>2017-02-28T11:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Quick idea to run ilogic rule on view representation change</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/7943164#M83438</link>
      <description>&lt;P&gt;I really am intrigued by this, i have learned ilogic and this is the first time that i am seeing such code that is run in this matter.&lt;BR /&gt;&lt;BR /&gt;Could you please help me in a similar action?&lt;BR /&gt;&lt;BR /&gt;I am trying to run a rule after Visibility Change in the model. Yet there is nothing on the web that will help me learn and understand how to do this. I believe after stumbling on this, that you may be able to help me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Looking forward to your comments.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 23:13:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/7943164#M83438</guid>
      <dc:creator>DeerSpotter</dc:creator>
      <dc:date>2018-04-18T23:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Quick idea to run ilogic rule on view representation change</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/7944469#M83462</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1229836"&gt;@DeerSpotter&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By Visibility change in the model, I assume you mean the below?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="insetr.png" style="width: 955px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/490619i82B602422D031BD9/image-size/large?v=v2&amp;amp;px=999" role="button" title="insetr.png" alt="insetr.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So you are looking to execute a ilogic rule whenever a user changes the above options?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sajith&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:30:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/7944469#M83462</guid>
      <dc:creator>sajith_subramanian</dc:creator>
      <dc:date>2018-04-19T11:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Quick idea to run ilogic rule on view representation change</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/7946408#M83482</link>
      <description>&lt;P&gt;Or do you mean Component.visibility = False or True ???&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 22:29:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/quick-idea-to-run-ilogic-rule-on-view-representation-change/m-p/7946408#M83482</guid>
      <dc:creator>yvandelafontaine</dc:creator>
      <dc:date>2018-04-19T22:29:59Z</dc:date>
    </item>
  </channel>
</rss>

