<?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 Re: Expression to group components? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10868369#M41744</link>
    <description>&lt;P&gt;In your main rule you can create a SharedVariable. In other rules you can use this sharedVariable.&lt;BR /&gt;&lt;BR /&gt;so rule1:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;MyGroup&lt;/SPAN&gt; = &lt;SPAN&gt;New&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;(){&lt;SPAN&gt;"P144-00030:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"P144-00029:2"&lt;/SPAN&gt;,&lt;SPAN&gt;"P133-00210:1"&lt;/SPAN&gt;}

&lt;SPAN&gt;SharedVariable&lt;/SPAN&gt;(&lt;SPAN&gt;"MyGroup"&lt;/SPAN&gt;) = &lt;SPAN&gt;MyGroup&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rule2:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oVal&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;SharedVariable&lt;/SPAN&gt;(&lt;SPAN&gt;"MyGroup"&lt;/SPAN&gt;)
		&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;oVal&lt;/SPAN&gt;) = &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jan 2022 08:17:53 GMT</pubDate>
    <dc:creator>theo.bot</dc:creator>
    <dc:date>2022-01-10T08:17:53Z</dc:date>
    <item>
      <title>Expression to group components?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10861528#M41740</link>
      <description>&lt;P&gt;In Ilogic rules, is it possible to create and expression that groups a selection of components, so that all these components can be referenced with one expression (e.g. Component.Isactive(group)=True or False)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give an idea of what I am trying t&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;--------&lt;BR /&gt;component_group&lt;/SPAN&gt;=&lt;SPAN&gt;List&lt;/SPAN&gt;(&lt;SPAN&gt;"Assembly1", "Assembly2", "Assembly3", "Assembly4",..., "Assembly99"&lt;/SPAN&gt;)
&lt;BR /&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;statement1&lt;/SPAN&gt;=True &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;component_group&lt;/SPAN&gt;)=&lt;SPAN&gt;True&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;statement1&lt;/SPAN&gt;=False &lt;SPAN&gt;Then&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;component_group&lt;/SPAN&gt;)=&lt;SPAN&gt;False&lt;/SPAN&gt;

EndIf
--------&lt;BR /&gt;I hope it is apparent what I am trying to achieve. Otherwise, let me know.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 09:39:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10861528#M41740</guid>
      <dc:creator>ndamgaard</dc:creator>
      <dc:date>2022-01-06T09:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to group components?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10861616#M41741</link>
      <description>&lt;P&gt;You can use this idea, but you need to add a loop in you code to suppress each component. Here's a small sample:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;MyGroup&lt;/SPAN&gt; = &lt;SPAN&gt;New&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;(){&lt;SPAN&gt;"P144-00030:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"P144-00029:2"&lt;/SPAN&gt;,&lt;SPAN&gt;"P133-00210:1"&lt;/SPAN&gt;}

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oVal&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;MyGroup&lt;/SPAN&gt;
		&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;oVal&lt;/SPAN&gt;) = &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 10:57:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10861616#M41741</guid>
      <dc:creator>theo.bot</dc:creator>
      <dc:date>2022-01-06T10:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to group components?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10862039#M41742</link>
      <description>&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 14:19:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10862039#M41742</guid>
      <dc:creator>ndamgaard</dc:creator>
      <dc:date>2022-01-06T14:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to group components?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10868282#M41743</link>
      <description>Hello Theo,&lt;BR /&gt;&lt;BR /&gt;A follow up question: Can I reference MyGroup in another rule?&lt;BR /&gt;&lt;BR /&gt;I wish to keep my categories in its own rule, if possible.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jan 2022 07:18:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10868282#M41743</guid>
      <dc:creator>ndamgaard</dc:creator>
      <dc:date>2022-01-10T07:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to group components?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10868369#M41744</link>
      <description>&lt;P&gt;In your main rule you can create a SharedVariable. In other rules you can use this sharedVariable.&lt;BR /&gt;&lt;BR /&gt;so rule1:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;MyGroup&lt;/SPAN&gt; = &lt;SPAN&gt;New&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;(){&lt;SPAN&gt;"P144-00030:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"P144-00029:2"&lt;/SPAN&gt;,&lt;SPAN&gt;"P133-00210:1"&lt;/SPAN&gt;}

&lt;SPAN&gt;SharedVariable&lt;/SPAN&gt;(&lt;SPAN&gt;"MyGroup"&lt;/SPAN&gt;) = &lt;SPAN&gt;MyGroup&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rule2:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oVal&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;SharedVariable&lt;/SPAN&gt;(&lt;SPAN&gt;"MyGroup"&lt;/SPAN&gt;)
		&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;oVal&lt;/SPAN&gt;) = &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 08:17:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/expression-to-group-components/m-p/10868369#M41744</guid>
      <dc:creator>theo.bot</dc:creator>
      <dc:date>2022-01-10T08:17:53Z</dc:date>
    </item>
  </channel>
</rss>

