<?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: Trouble configuring subassembly with a rule in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/trouble-configuring-subassembly-with-a-rule/m-p/5924937#M60106</link>
    <description>&lt;P&gt;For what it's worth, this seems&amp;nbsp;to be resolved now.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2015 17:44:59 GMT</pubDate>
    <dc:creator>tginder</dc:creator>
    <dc:date>2015-11-25T17:44:59Z</dc:date>
    <item>
      <title>Trouble configuring subassembly with a rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/trouble-configuring-subassembly-with-a-rule/m-p/5916390#M60005</link>
      <description>&lt;P&gt;I have a top level assembly with a lot of parameters that I want to feed to various subassemblies, which should, ideally, configure themselves using their own rules. In this case I have a user parameter called 'LINER_PACKAGE' that I want to pass text to various subassemblies which will do what they respectively need to do with that text parameter input from the upper level assembly. I have a form the user will use to select a liner package from a drop-down. The following code then passes the liner info to the subassembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;LINER_PACKAGE&lt;/SPAN&gt; &lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;MODEL-BN:1&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;LINER_PACKAGE&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;LINER_PACKAGE&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That part appears to work. The user property 'LINER_PACKAGE' in the subassembly MODEL-BN is populated with the same text as appears in the upper level assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want the subassembly MODEL-BN to then do something with that info, namely suppress the parts not related to that liner package, and unsuppress the parts that are. Here's a bit of code from a rule in the subassembly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;LINER_PACKAGE&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;10 GA. GALV.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;Component&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;IsActive&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;R2115271:1&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;True&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;LINER_PACKAGE&lt;/SPAN&gt; &lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;10 GA. GALV.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
&lt;SPAN&gt;Component&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;IsActive&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;R2115271:1&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And that works when testing the sub-assembly alone changing the parameter value manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT, when I change the parameter using the upper level assembly's rule I get this message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule: PUSH_DATA_TO_CHILDREN, in document: CEBE_Skeleton.iam&lt;/P&gt;&lt;P&gt;Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MORE INFO TAB reveals:&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;BR /&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;at Inventor.Parameter.set_Value(Object )&lt;BR /&gt;at iLogic.ParamDynamicFinder.SetParamValue(Parameter param, Object value, Boolean doUpdate)&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it appears as though the rule in the subassembly never fired.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Help please? Ive been spinning my wheels most of the day on this one.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 18:55:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/trouble-configuring-subassembly-with-a-rule/m-p/5916390#M60005</guid>
      <dc:creator>sporqster</dc:creator>
      <dc:date>2015-11-19T18:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble configuring subassembly with a rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/trouble-configuring-subassembly-with-a-rule/m-p/5924937#M60106</link>
      <description>&lt;P&gt;For what it's worth, this seems&amp;nbsp;to be resolved now.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 17:44:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/trouble-configuring-subassembly-with-a-rule/m-p/5924937#M60106</guid>
      <dc:creator>tginder</dc:creator>
      <dc:date>2015-11-25T17:44:59Z</dc:date>
    </item>
  </channel>
</rss>

