<?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: Component.IsActive causes Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651554#M12270</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp; Thanks for explaining this! Will try implementing your suggestions but it makes sense to me.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 18:02:12 GMT</pubDate>
    <dc:creator>florescu.d95</dc:creator>
    <dc:date>2024-03-19T18:02:12Z</dc:date>
    <item>
      <title>Component.IsActive causes Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12648502#M12267</link>
      <description>&lt;P&gt;I've been having the following issue with Inventor 2024 iLogic:&lt;/P&gt;&lt;P&gt;Assembly is comprised of 2 sub assemblies, each with it's own ilogic rule.&lt;/P&gt;&lt;P&gt;When the sub assembly rule is ran from main assembly using iLogicVb.RunRule the&amp;nbsp;Unspecified error appears.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When ran directly from the sub assembly everything works fine&lt;/P&gt;&lt;P&gt;Line 14 is:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;"FacePlate1_85_DOWN:1"&lt;/SPAN&gt;) = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florescud95_0-1710778577056.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1338519iAF952FF257AE5BD0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florescud95_0-1710778577056.png" alt="florescud95_0-1710778577056.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 12:32:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12648502#M12267</guid>
      <dc:creator>florescu.d95</dc:creator>
      <dc:date>2024-03-19T12:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Component.IsActive causes Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12650805#M12268</link>
      <description>&lt;P&gt;I couldn't recreate this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this part use model states? It used to require you to create a LOD when you would suppress components. Maybe some of this is still hard coded with model states? Worst case you will have to create a new model state for suppressing that component.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Component.ActiveModelState("Part1:1") = "ModelState1"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option is to try changing the objectProvider for the ilogic functions. This is a far-shot b/c it should already be like this.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;CreateObjectProvider&lt;/SPAN&gt;(&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;).&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;"FacePlate1_85_DOWN:1"&lt;/SPAN&gt;) = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you could try to suppress the component from the top level assembly and use the "MakePath" function.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Component&lt;/SPAN&gt;.&lt;SPAN&gt;IsActive&lt;/SPAN&gt;(&lt;SPAN&gt;MakePath&lt;/SPAN&gt;(&lt;SPAN&gt;"SubAssem1:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part2:1"&lt;/SPAN&gt;)) = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 17:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12650805#M12268</guid>
      <dc:creator>daltonNYAW9</dc:creator>
      <dc:date>2024-03-19T17:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Component.IsActive causes Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651456#M12269</link>
      <description>&lt;P&gt;Hi guys.&amp;nbsp;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14677317"&gt;@daltonNYAW9&lt;/a&gt;&amp;nbsp;was on the right path, but there is still another irritating detail you may need to keep in mind.&amp;nbsp; The '&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=a7af8e53-7944-ff0c-62ce-b023a2434819" target="_blank" rel="noopener"&gt;Component&lt;/A&gt;' term is a '&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=4ccb78b0-c35c-4d38-943a-854117da6ced" target="_blank" rel="noopener"&gt;Rule Object&lt;/A&gt;', and it does not document clearly which document it will be targeting when it attempts to work with some specific component within that document.&amp;nbsp; I believe that if that term is used in an internal (saved within the document) iLogic rule, it will target the document that the rule is saved within, by default, but could potentially target another document in certain rarer conditions.&amp;nbsp; However, if used in an external iLogic rule, it will most likely target the document that was 'active' (visible on your screen) when the rule started.&amp;nbsp; So, if that rule was in a sub assembly, and it ran while the main assembly was 'active', it may be looking or that component directly in the main assembly (as one of its top level components), instead of looking within that sub assembly.&amp;nbsp; To avoid that problem, you may need to use more specific code, such as the Inventor API way of suppressing or un-suppressing a component.&amp;nbsp; The Inventor API way is to get a reference to the actual&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-ComponentOccurrence" target="_blank" rel="noopener"&gt;ComponentOccurrence&lt;/A&gt;&amp;nbsp;object you want to control, then use one of the following.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ComponentOccurrence_Suppress" target="_blank" rel="noopener"&gt;ComponentOccurrence.Suppress&lt;/A&gt;&amp;nbsp;(a method to suppress it)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ComponentOccurrence_Unsuppress" target="_blank" rel="noopener"&gt;ComponentOccurrence.Unsuppress&lt;/A&gt;&amp;nbsp;(a method to unsuppress it)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ComponentOccurrence_Suppressed" target="_blank" rel="noopener"&gt;ComponentOccurrence.Suppressed&lt;/A&gt;&amp;nbsp;(a ReadOnly property to check its current suppression status)&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 17:16:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651456#M12269</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-03-19T17:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Component.IsActive causes Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651554#M12270</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp; Thanks for explaining this! Will try implementing your suggestions but it makes sense to me.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 18:02:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651554#M12270</guid>
      <dc:creator>florescu.d95</dc:creator>
      <dc:date>2024-03-19T18:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Component.IsActive causes Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651605#M12271</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10187446"&gt;@florescu.d95&lt;/a&gt;.&amp;nbsp; Just in case you are not familiar with the Inventor API way I mentioned, here is a very short example iLogic rule showing how to get a reference to that one specific component, by its name, then toggle its suppression.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oADoc As AssemblyDocument = TryCast(ThisDoc.Document, Inventor.AssemblyDocument)
If oADoc Is Nothing Then Return
Dim oOccs As ComponentOccurrences = oADoc.ComponentDefinition.Occurrences
Dim oFP1_81_Down1 As ComponentOccurrence = oOccs.ItemByName("FacePlate1_85_DOWN:1")
'toggle its suppression each time
If oFP1_81_Down1.Suppressed Then
	oFP1_81_Down1.Suppress
Else
	oFP1_81_Down1.Unsuppress
End If&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Mar 2024 18:27:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/component-isactive-causes-unspecified-error-exception-from/m-p/12651605#M12271</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-03-19T18:27:54Z</dc:date>
    </item>
  </channel>
</rss>

