<?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: Rule to delete PFD object not working from assembly environment in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933289#M134339</link>
    <description>&lt;P&gt;Avoid to use&amp;nbsp;&lt;STRONG&gt;ThisApplication.ActiveDocument&lt;/STRONG&gt; Use &lt;STRONG&gt;ThisDoc.Document&lt;/STRONG&gt; instead.&lt;/P&gt;&lt;P&gt;ThisDoc references to the document in which context the rule is running.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 11:12:38 GMT</pubDate>
    <dc:creator>Michael.Navara</dc:creator>
    <dc:date>2022-02-07T11:12:38Z</dc:date>
    <item>
      <title>Rule to delete PFD object not working from assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933252#M134336</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;I would like your help to understand the below.&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@654EFF2419D8AA46C02C7BA8582B44D6/emoticons/1f60a.png" alt=":smiling_face_with_smiling_eyes:" title=":smiling_face_with_smiling_eyes:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below rule is included in one of my Inventor parts, it is used to delete a pdf file included as 3rd party object.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The rule works perfectly when I run inside the part environment, but when I request to run straight from the assembly&amp;nbsp; environment with &lt;U&gt;ilogicVb.RunRule ("partABC", "Rule break link")&lt;/U&gt; it does &lt;STRONG&gt;nothing.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the reason?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the rule included in the part file.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;ref&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ReferencedOLEFileDescriptor&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedOLEFileDescriptors&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; (&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Material"&lt;/SPAN&gt;) = &lt;SPAN&gt;"ABC"&lt;/SPAN&gt;) &lt;SPAN&gt;And&lt;/SPAN&gt; (&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"Type"&lt;/SPAN&gt;) = &lt;SPAN&gt;"X"&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; (&lt;SPAN&gt;ref&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt; = &lt;SPAN&gt;"PDFA.pdf"&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN&gt;ref&lt;/SPAN&gt;.&lt;SPAN&gt;Delete&lt;/SPAN&gt;() &lt;SPAN&gt;'delete reference &lt;BR /&gt;&lt;BR /&gt;End if &lt;BR /&gt;&lt;/SPAN&gt;End if &lt;BR /&gt;Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 10:54:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933252#M134336</guid>
      <dc:creator>caroline_ccc</dc:creator>
      <dc:date>2022-02-07T10:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rule to delete PFD object not working from assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933289#M134339</link>
      <description>&lt;P&gt;Avoid to use&amp;nbsp;&lt;STRONG&gt;ThisApplication.ActiveDocument&lt;/STRONG&gt; Use &lt;STRONG&gt;ThisDoc.Document&lt;/STRONG&gt; instead.&lt;/P&gt;&lt;P&gt;ThisDoc references to the document in which context the rule is running.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 11:12:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933289#M134339</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2022-02-07T11:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rule to delete PFD object not working from assembly environment</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933334#M134343</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1104556"&gt;@Michael.Navara&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your fast reply and it works perfectly!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 11:32:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-to-delete-pfd-object-not-working-from-assembly-environment/m-p/10933334#M134343</guid>
      <dc:creator>caroline_ccc</dc:creator>
      <dc:date>2022-02-07T11:32:07Z</dc:date>
    </item>
  </channel>
</rss>

