<?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 to Check if iPart exists in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-check-if-ipart-exists/m-p/8266743#M88830</link>
    <description>&lt;P&gt;The easiest solution to use is to wrap the ChangeRow function in a Try statement.&amp;nbsp; Here's an example:&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;oLength&lt;/SPAN&gt; = 20 &lt;SPAN&gt;'input the Length your looking for here.&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;iPart&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;"iComponentName:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"Length"&lt;/SPAN&gt;, &lt;SPAN&gt;"="&lt;/SPAN&gt;, &lt;SPAN&gt;oLength&lt;/SPAN&gt;)
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Part Length of "&lt;/SPAN&gt; + &lt;SPAN&gt;CStr&lt;/SPAN&gt;(&lt;SPAN&gt;oLength&lt;/SPAN&gt;) + &lt;SPAN&gt;" not found!"&lt;/SPAN&gt;, _
	&lt;SPAN&gt;"Length Error"&lt;/SPAN&gt;, _
	&lt;SPAN&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN&gt;OK&lt;/SPAN&gt;, _
	&lt;SPAN&gt;MessageBoxIcon&lt;/SPAN&gt;.&lt;SPAN&gt;Hand&lt;/SPAN&gt;, _
	&lt;SPAN&gt;MessageBoxDefaultButton&lt;/SPAN&gt;.&lt;SPAN&gt;Button1&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It will try to find a row where the column "Length" has a value of 20, if it's found, it will automatically change to that row.&amp;nbsp; If an error occurs, it will catch that error and display a message box for you.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 19:12:18 GMT</pubDate>
    <dc:creator>philip1009</dc:creator>
    <dc:date>2018-09-13T19:12:18Z</dc:date>
    <item>
      <title>iLogic to Check if iPart exists</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-check-if-ipart-exists/m-p/8266688#M88829</link>
      <description>&lt;P&gt;how would i go about trying to see if an ipart exists? for example,&amp;nbsp;say i have a part with members/part numbers 10,20,30...100 which corresponds to extrusion height.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have an excel sheet where there are some calculation being made which gives me the extrusion height. then, i would want to use the ipart.changerow() command to change to the correct ipart IF the calculated ipart part number exists.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so say the formula gives me a 20 for the height, then the part in my assembly would change to the 20 row, but if the formula gave me 25, then the part would do nothing and would not change configuration.&lt;/P&gt;&lt;P&gt;is this possible?&lt;/P&gt;&lt;P&gt;hopefully this makes sense&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 18:52:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-check-if-ipart-exists/m-p/8266688#M88829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-13T18:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic to Check if iPart exists</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-check-if-ipart-exists/m-p/8266743#M88830</link>
      <description>&lt;P&gt;The easiest solution to use is to wrap the ChangeRow function in a Try statement.&amp;nbsp; Here's an example:&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;oLength&lt;/SPAN&gt; = 20 &lt;SPAN&gt;'input the Length your looking for here.&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;iPart&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;"iComponentName:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"Length"&lt;/SPAN&gt;, &lt;SPAN&gt;"="&lt;/SPAN&gt;, &lt;SPAN&gt;oLength&lt;/SPAN&gt;)
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Part Length of "&lt;/SPAN&gt; + &lt;SPAN&gt;CStr&lt;/SPAN&gt;(&lt;SPAN&gt;oLength&lt;/SPAN&gt;) + &lt;SPAN&gt;" not found!"&lt;/SPAN&gt;, _
	&lt;SPAN&gt;"Length Error"&lt;/SPAN&gt;, _
	&lt;SPAN&gt;MessageBoxButtons&lt;/SPAN&gt;.&lt;SPAN&gt;OK&lt;/SPAN&gt;, _
	&lt;SPAN&gt;MessageBoxIcon&lt;/SPAN&gt;.&lt;SPAN&gt;Hand&lt;/SPAN&gt;, _
	&lt;SPAN&gt;MessageBoxDefaultButton&lt;/SPAN&gt;.&lt;SPAN&gt;Button1&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It will try to find a row where the column "Length" has a value of 20, if it's found, it will automatically change to that row.&amp;nbsp; If an error occurs, it will catch that error and display a message box for you.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 19:12:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-check-if-ipart-exists/m-p/8266743#M88830</guid>
      <dc:creator>philip1009</dc:creator>
      <dc:date>2018-09-13T19:12:18Z</dc:date>
    </item>
  </channel>
</rss>

