<?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 Automation code error in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14028321#M179524</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&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 your answer. I have attached my code as a text file.&lt;/P&gt;&lt;P&gt;What I tried to achieve with BOMView is to have a parts list displayed in the drawing.&lt;/P&gt;&lt;P&gt;Is there another possibility to use iLogic with a template where all the different views are already placed and it just updates them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Feb 2026 07:01:03 GMT</pubDate>
    <dc:creator>gereon.cramer</dc:creator>
    <dc:date>2026-02-23T07:01:03Z</dc:date>
    <item>
      <title>ILogic Automation code error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14025995#M179502</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am relatively inexperienced in programming and have just tried to "automate" the creation of a railing and the updating of the production drawing based on a template using an iLogic code with the help of ChatGPT. However, I am now at the point where I still have three error messages that I just can't get rid of, and when ChatGPT tries to solve them, all the old errors come back again. Can you help me figure out if what I have in mind is even possible and where the mistake might be? I am attaching the code as a screenshot, and you can find the error messages directly below it. I would appreciate any feedback. Version: Inventor Professional 2026 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in line 17: 'FindOccurrenceRecursive' was not declared. Access may not be possible due to its protection level.&lt;BR /&gt;Error in line 38: 'FindOccurrenceRecursive' was not declared. Access may not be possible due to its protection level.&lt;BR /&gt;Error in line 74: The value of type 'ViewOrientationTypeEnum' cannot be converted to 'Point2d'.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2026 14:09:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14025995#M179502</guid>
      <dc:creator>gereon.cramer</dc:creator>
      <dc:date>2026-02-20T14:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic Automation code error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14026093#M179505</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12891567"&gt;@gereon.cramer&lt;/a&gt;.&amp;nbsp; It is very difficult to debug code by just an 'image' of it, especially when it is just an image of 'portions' of the code, rather than the whole thing.&amp;nbsp; When you need help with some code, it is always best to post the whole code, as selectable text.&amp;nbsp; There are two main ways to do that here.&amp;nbsp; The main (and most popular) way, is to use the forum reply tool that looks like this &amp;lt;/&amp;gt;.&amp;nbsp; When you click that tool, it inserts a 'code window' into your post or reply, where you can 'paste' your code into.&amp;nbsp; When you do that, the code will maintain its formatting, making it easier to read through.&amp;nbsp; Then other users can easily select your code and copy it, so they can paste it into a new iLogic rule to test and debug.&amp;nbsp; The other popular option, is to copy &amp;amp; paste your whole code into a new Notepad file (text file) and save it, then attach that text file to your post/reply.&amp;nbsp; Then the rest of us can download your text file, open it, copy &amp;amp; paste it into a code window to test.&amp;nbsp; This is usually the best option when the code is really long, so it does not take up the whole screen in the forum discussion.&lt;/P&gt;
&lt;P&gt;The first thing I saw that does not look right is the line of code starting with the following:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oBOMView As BOMView = oSheet.BOMViews.Add(oSheet, oBaseView, kBOMType_PartsOnly,...&lt;/LI-CODE&gt;
&lt;P&gt;What were you trying to do there?&amp;nbsp; A &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-BOMView" target="_blank" rel="noopener"&gt;BOMView&lt;/A&gt; is something that only exists within an Assembly, not within a Drawing.&amp;nbsp; It is not a type of drawing view.&amp;nbsp; It is one of the tabs within the assembly BOM dialog that presents that type of data in a specific way.&amp;nbsp; If we want to include a representation of an assembly BOM in a drawing, we do that through a &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-PartsList" target="_blank" rel="noopener"&gt;PartsList&lt;/A&gt;.&amp;nbsp; Other than that, there was an excessive use of the following code phrase:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;ThisApplication.ActiveDocument&lt;/LI-CODE&gt;
&lt;P&gt;Instead of using that in so many places, it usually only needs to be used once, then capture the value of that Property to a variable.&amp;nbsp; Then use that variable everywhere else in your code that needs to use that Inventor.Document object.&amp;nbsp; This is important not only for efficiency, but also because of Document Type.&amp;nbsp; The generic Inventor.Document Type does not have that many properties, because it is not specific enough.&amp;nbsp; If the active document is an assembly, then you should capture that as an Inventor.AssemblyDocument, which will have a whole lot more properties, and will work much better in places that need to access things that are unique to assemblies (not found in parts or drawings).&amp;nbsp; AI is just a tool to help, but does not replace the need to understand the code involved, for this reason and many other reasons.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2026 15:26:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14026093#M179505</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2026-02-20T15:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: ILogic Automation code error</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14028321#M179524</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&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 your answer. I have attached my code as a text file.&lt;/P&gt;&lt;P&gt;What I tried to achieve with BOMView is to have a parts list displayed in the drawing.&lt;/P&gt;&lt;P&gt;Is there another possibility to use iLogic with a template where all the different views are already placed and it just updates them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 07:01:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-automation-code-error/m-p/14028321#M179524</guid>
      <dc:creator>gereon.cramer</dc:creator>
      <dc:date>2026-02-23T07:01:03Z</dc:date>
    </item>
  </channel>
</rss>

