<?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: iLogic Rule works on some Sheetmetal Parts but not others.... in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833095#M117462</link>
    <description>&lt;P&gt;Do you mean it doesnt work in all parts that is also used as reference in the same sheet? If so, it because the code is only refering to the first item. It needs to iterate through all drawing references.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;STRONG&gt;Item(1) &lt;/STRONG&gt;'works only in the first item.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2020 19:27:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-29T19:27:08Z</dc:date>
    <item>
      <title>iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9832965#M117457</link>
      <description>&lt;P&gt;Hi Everybody,&lt;/P&gt;&lt;P&gt;i have an iLogic Rule that i want to run from a drawing. The rule will open the referenced part, Save it and close it...that simple(code shown below). Problem is, it doesn't work on all parts. Any advise would be greatly appreciated.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;refDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Documents&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;refDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Save&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;

&lt;SPAN&gt;refDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Close&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2020 18:05:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9832965#M117457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T18:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833051#M117460</link>
      <description>&lt;P&gt;Would this work for you instead?:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oMDoc As Document = ThisDrawing.ModelDocument
oMDoc.Save
oMDoc.Close&lt;/LI-CODE&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 18:52:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833051#M117460</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-10-29T18:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833056#M117461</link>
      <description>&lt;P&gt;Or perhaps this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim oViewDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
oViewDoc.Save
oViewDoc.Close&lt;/LI-CODE&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 18:55:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833056#M117461</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-10-29T18:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833095#M117462</link>
      <description>&lt;P&gt;Do you mean it doesnt work in all parts that is also used as reference in the same sheet? If so, it because the code is only refering to the first item. It needs to iterate through all drawing references.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;STRONG&gt;Item(1) &lt;/STRONG&gt;'works only in the first item.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 19:27:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833095#M117462</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T19:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833119#M117463</link>
      <description>&lt;P&gt;if you want to save all documents referenced (direct and indirect) by the drawing you could do this.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;refDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
    &lt;SPAN style="color: #800000;"&gt;refDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Save&lt;/SPAN&gt;()
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2020 19:30:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833119#M117463</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2020-10-29T19:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833184#M117466</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Do you mean it doesnt work in all parts that is also used as reference in the same sheet? If so, it because the code is only refering to the first item. It needs to iterate through all drawing references.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No, i mean when I run this rule on one drawing/model it works perfectly. When i run it on a completely different drawing connected to a different model, it doesn't work. i get the error shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;""Error in rule: SM_Drawing_Processing, in document: D04A01723-1__ATL_000.idw&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;&lt;FONT color="#FF0000"&gt;Error in rule: SM_Drawing_Processing, in document: D04A01723-1__ATL_000.idw&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 19:57:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833184#M117466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T19:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833193#M117467</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;if you want to save all documents referenced (direct and indirect) by the drawing you could do this.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;refDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
    &lt;SPAN style="color: #800000;"&gt;refDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Save&lt;/SPAN&gt;()
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is interesting to my newbie brain! Can i used this in an assembly to iterate thru each part?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 20:02:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9833193#M117467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-29T20:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834516#M117496</link>
      <description>&lt;P&gt;Yes.&amp;nbsp; Using the document's AllReferencedDocuments property like that is one of the most common ways to iterate through all documents within an assembly.&amp;nbsp; It is often more efficient than when iterating through the assembly's ComponentOccurrences, because you can have multiple ComponentOccurrences that all represent the same source document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is another way to iterate through each sheet, and each view within each sheet of a drawing, and getting the document being represented within those views.&amp;nbsp; However, if the same document is being represented within multiple views, your Save() code may run on that document multiple times.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet
Dim oView As DrawingView
Dim oViewDoc As Document
For Each oSheet In oDDoc.Sheets
	For Each oView In oSheet.DrawingViews
		oViewDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
		oViewDoc.Save()
	Next
Next&lt;/LI-CODE&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 10:49:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834516#M117496</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-10-30T10:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834718#M117499</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Yes.&amp;nbsp; Using the document's AllReferencedDocuments property like that is one of the most common ways to iterate through all documents within an assembly.&amp;nbsp; It is often more efficient than when iterating through the assembly's ComponentOccurrences, because you can have multiple ComponentOccurrences that all represent the same source document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is another way to iterate through each sheet, and each view within each sheet of a drawing, and getting the document being represented within those views.&amp;nbsp; However, if the same document is being represented within multiple views, your Save() code may run on that document multiple times.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet
Dim oView As DrawingView
Dim oViewDoc As Document
For Each oSheet In oDDoc.Sheets
	For Each oView In oSheet.DrawingViews
		oViewDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
		oViewDoc.Save()
	Next
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is so AWESOMMMEEE!! It fixes an issue i was ABOUT to try to address. The other issue is still an issue tho &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@F462EEC827775DA92CB03B7FC147D389/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 12:15:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834718#M117499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-30T12:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834862#M117500</link>
      <description>&lt;P&gt;It sounds like we need to know more details, before we can help you further.&lt;/P&gt;&lt;P&gt;When you post what the error message says, capture the text or screen captured image from both tabs of the error message.&amp;nbsp; Often the second tab contains much more information, and may give us a clue as to where in the code it is having a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Also, there are many different ways to "debug" (find and/or weed out potential errors) in code, and we may have to include one of these techniques here, to give us a better understanding of where,when, and why it is either throwing errors, or not working as expected.&amp;nbsp; If you have Inventor 2019.1 (I believe) or later then you should have the iLogicLog tab available (or can be turned on), and the ability to write things to the iLogic log as your code starts, progresses, and ends (depending on how you set it up and what level of the Log you are using).&amp;nbsp; Or as a "fast &amp;amp; loose" option, you could put something like MsgBox(1), or MsgBox(2)...etc after each line within your code, then when you run it, pay attention to the last number it shows before it throws an error, and that will tell you that the next line after that numbered MsgBox() is where it is having trouble.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Then there are ways to attempt to avoid expected errors.&amp;nbsp; The current standard for this within iLogic (vb.net) is the Try...Catch...End Try block.&amp;nbsp; Within the Try portion, you try to do what you want, then in the Catch portion you put what do do if the Try portion fails.&amp;nbsp; This can be very useful to prevent your code from abruptly stopping because of an error, and if you property utilize the Catch portion, it can potentially give you very meaningful feedback as to what went wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Here is an updated version of my earlier code that includes another "check" and a couple of Try...Catch...End Try blocks in there, that I'm hoping will offer some meaningful feedback.&amp;nbsp; Let me know how this works out for you, and any messages you're seeing if things don't fully work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet
Dim oView As DrawingView
Dim oViewDoc As Document
For Each oSheet In oDDoc.Sheets
	If oSheet.DrawingViews.Count &amp;gt; 0 Then
		For Each oView In oSheet.DrawingViews
			Try
				oViewDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
			Catch
				MsgBox("A Model document couldn't be retrieved from the following View:" &amp;amp; vbCrLf &amp;amp; _
				"Sheet:  [" &amp;amp; oSheet.Name &amp;amp; "] View: [" &amp;amp; oView.Name, vbOKOnly + vbInformation, " ")
				Continue For
			End Try
			Try
				oViewDoc.Save()
			Catch
				MsgBox("We've found the Model document in the following View:" &amp;amp; vbCrLf &amp;amp; _
				"Sheet:  [" &amp;amp; oSheet.Name &amp;amp; "] View: [" &amp;amp; oView.Name &amp;amp; vbCrLf &amp;amp; _
				"But the attempt to simply Save (not SaveAs) failed.", vbOKOnly + vbCritical, " ")
			End Try
		Next
	End If
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 13:19:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834862#M117500</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-10-30T13:19:51Z</dc:date>
    </item>
    <item>
      <title>@Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834958#M117505</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp; maybe there is an error on your referenced model that needs to be addressed before it allows saving. or maybe an event trigger.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 13:53:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9834958#M117505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-30T13:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: @Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9835569#M117516</link>
      <description>&lt;P&gt;Ok here's the whole spill &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@39127645CC419995F9A3AC01693C520D/emoticons/1f611.png" alt=":expressionless_face:" title=":expressionless_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have rule that does the stuff i need to do. From a drawing:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;checks to make sure the referenced model matches the drawing&lt;/LI&gt;&lt;LI&gt;opens the referenced model and &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;saves&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;. This will trigger two external rules&lt;OL&gt;&lt;LI&gt;updated everything to make sure the dxf will be accurate.&lt;/LI&gt;&lt;LI&gt;creates the dxf.&lt;/LI&gt;&lt;LI&gt;Closes the model and goes back to the idw&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;PDF's the drawings.&lt;/P&gt;&lt;P&gt;This is the code for the&amp;nbsp; checking portion of the rule&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Imports&lt;/SPAN&gt; &lt;SPAN&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Threading&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Tasks&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;timeout&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;1.5&lt;/SPAN&gt; &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt; secs&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;msg&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;New&lt;/SPAN&gt; &lt;SPAN&gt;Form&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt; &lt;SPAN&gt;With&lt;/SPAN&gt;&lt;SPAN&gt; { .&lt;/SPAN&gt;&lt;SPAN&gt;Enabled&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt; }

&lt;/SPAN&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;refDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Documents&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Dim addin As ApplicationAddIn 'xxxxxx&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;Dim iLogicAuto As Object = addin.Automation'xxxxxx&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oDoc = ThisDoc.FileName(False) 'without extension'xxxxxx&lt;/SPAN&gt;
&lt;SPAN&gt;attachedModel&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Path&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;IO&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;GetFileName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ThisDrawing&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ModelDocument&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;PreModel&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ChangeExtension&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.ipt&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;intendedModel&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Replace&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PreModel&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;-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;-0_&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;MessageBox.Show("attachedModel = " &amp;amp; attachedModel, "iLogic")&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;attachedModel&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;intendedModel&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
        &lt;SPAN&gt;Task&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Delay&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TimeSpan&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FromSeconds&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;timeout&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ContinueWith&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;
        &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; 
            &lt;SPAN&gt;msg&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Close&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt; 
        &lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;SPAN&gt; ,
    &lt;/SPAN&gt;&lt;SPAN&gt;TaskScheduler&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FromCurrentSynchronizationContext&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;
    &lt;SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Show&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;msg&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Model/Drawing Matches&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;iLogic&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;refDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Save&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
    &lt;SPAN&gt;refDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Close&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;    Parameter("d0") = 1.2&lt;/SPAN&gt;

&lt;SPAN&gt;Else&lt;/SPAN&gt; 
    &lt;SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Show&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;The drawing has the wrong model attached&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;iLogic&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;Return&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;This is the code that calls the model and pdf's after it is done.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sheet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;refDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Documents&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFile&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;FullFileName&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;RunExternalRule&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;ModelMatchDrawing&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;refDoc.Save()&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;refDoc.Close()&lt;/SPAN&gt;
&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;RunExternalRule&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;PDFit&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Oct 2020 18:32:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9835569#M117516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-30T18:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: @Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9835687#M117517</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;&lt;/P&gt;&lt;P&gt;I meant to tag you in the above as well.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 19:44:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9835687#M117517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-30T19:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: @Re: iLogic Rule works on some Sheetmetal Parts but not others....</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9840829#M117571</link>
      <description>&lt;P&gt;In both of those two codes, it looks like you need to replace:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim refDoc As Document = ThisApplication.Documents.Open(view.ReferencedFile.FullFileName)&lt;/LI-CODE&gt;&lt;P&gt;with this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim refDoc As Document = ThisApplication.Documents.Open(view.ReferencedDocumentDescriptor.FullDocumentName)&lt;/LI-CODE&gt;&lt;P&gt;because the 'view' object (DrawingView) doesn't support ReferencedFile directly.&lt;/P&gt;&lt;P&gt;Plus, the 'Open' function actually prefers the FullDocumentName vs the FullFileName (though usually not necessary unless dealing with documents within an assembly).&lt;/P&gt;&lt;P&gt;Here are the links for those objects.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-D273D9C3-C24F-4CDD-B571-F2C0B5F7A5B3" target="_blank" rel="noopener"&gt;DrawingView Object&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-F4713464-EDC8-471C-B757-EA9460253B5D" target="_blank" rel="noopener"&gt;DrawingView.ReferencedDocumentDescriptor Property&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-12201460-B598-4C0D-852F-F206D661C33D" target="_blank" rel="noopener"&gt;DocumentDescriptor Object&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2020 19:13:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-rule-works-on-some-sheetmetal-parts-but-not-others/m-p/9840829#M117571</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-11-02T19:13:05Z</dc:date>
    </item>
  </channel>
</rss>

