<?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: Pulling data for parameters from spreadsheet in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11824626#M25969</link>
    <description>&lt;P&gt;&lt;STRONG&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8201021"&gt;@BeasterlyJEC92&lt;/a&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Have you assigned a column name of a object type string to the variable col? At the moment you have a variable set to another vairable&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Col&lt;/SPAN&gt; = &lt;SPAN&gt;Col_Name&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;If you don’t find the parameter name in the excel sheet the code should &amp;nbsp;return -1 and you can use this in an if statement along with a continue for line to move to next parameter.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 00:27:22 GMT</pubDate>
    <dc:creator>A.Acheson</dc:creator>
    <dc:date>2023-03-16T00:27:22Z</dc:date>
    <item>
      <title>Pulling data for parameters from spreadsheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11824154#M25968</link>
      <description>&lt;P&gt;I am trying to grab parameters from a spreadsheet to generate parts (similar to an i-part but without the link to the base part).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got it to grab the parameters I add to the sheet, but it is also assigning values to parameters that are not in the spreadsheet? seems to default to the first cell. How do I stop this behavior?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Incorrect values:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BeasterlyJEC92_1-1678910798736.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189208i9BEA4F02FBA035C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BeasterlyJEC92_1-1678910798736.png" alt="BeasterlyJEC92_1-1678910798736.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to tell it to only grab parameters that exist in the spreadsheet that match the model parameters?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'sets multivalue list of all model parameters&lt;/SPAN&gt;
&lt;SPAN&gt;ModParams&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;ModelParameters&lt;/SPAN&gt;

&lt;SPAN&gt;'sets associated Excell file, Passes user text for file name: &lt;/SPAN&gt;
&lt;SPAN&gt;ExcelFile&lt;/SPAN&gt; = &lt;SPAN&gt;"C:\CHS\Small Cell\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Exc_file&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;".xls"&lt;/SPAN&gt;

&lt;SPAN&gt;'Passes user text for coloumn name containing values: &lt;/SPAN&gt;
&lt;SPAN&gt;Col&lt;/SPAN&gt; = &lt;SPAN&gt;Col_Name&lt;/SPAN&gt;

&lt;SPAN&gt;'Passes user text for sheet name: &lt;/SPAN&gt;
&lt;SPAN&gt;ExSheet&lt;/SPAN&gt; = &lt;SPAN&gt;Excell_Sheet&lt;/SPAN&gt;

&lt;SPAN&gt;'opens the excell file&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;Exc_file&lt;/SPAN&gt;, &lt;SPAN&gt;ExSheet&lt;/SPAN&gt;)

&lt;SPAN&gt;'sets where to find the title row&lt;/SPAN&gt;
&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;TitleRow&lt;/SPAN&gt; = 1

&lt;SPAN&gt;'cycle through all numerical model parameters And Do a thing.&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oParam&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;ModParams&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oParam&lt;/SPAN&gt;.&lt;SPAN&gt;Units&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;"Text"&lt;/SPAN&gt; &lt;SPAN&gt;And&lt;/SPAN&gt; &lt;SPAN&gt;oParam&lt;/SPAN&gt;.&lt;SPAN&gt;Units&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;"Boolean"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; 
		&lt;SPAN&gt;ParameterName&lt;/SPAN&gt; = &lt;SPAN&gt;oParam&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;
			&lt;SPAN&gt;'find in spreadsheet Row matching the inventor parameter name&lt;/SPAN&gt;
			&lt;SPAN&gt;Ex_Parameter_Name&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;FindRow&lt;/SPAN&gt;(&lt;SPAN&gt;ExcelFile&lt;/SPAN&gt;, &lt;SPAN&gt;ExSheet&lt;/SPAN&gt;, &lt;SPAN&gt;"Parameter"&lt;/SPAN&gt;, &lt;SPAN&gt;"="&lt;/SPAN&gt;, &lt;SPAN&gt;ParameterName&lt;/SPAN&gt;)
		
			&lt;SPAN&gt;'get the value from user specified coloumn&lt;/SPAN&gt;
			&lt;SPAN&gt;value&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CurrentRowValue&lt;/SPAN&gt;(&lt;SPAN&gt;Col&lt;/SPAN&gt;)
			&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;ParameterName&lt;/SPAN&gt;) = &lt;SPAN&gt;value&lt;/SPAN&gt;
			
			
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt;
&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentUpdate&lt;/SPAN&gt;()&lt;/PRE&gt;&lt;P&gt;Example of parameters I want to grab:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BeasterlyJEC92_0-1678910705792.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189206iA1914AEA04553366/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BeasterlyJEC92_0-1678910705792.png" alt="BeasterlyJEC92_0-1678910705792.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 20:09:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11824154#M25968</guid>
      <dc:creator>BeasterlyJEC92</dc:creator>
      <dc:date>2023-03-15T20:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data for parameters from spreadsheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11824626#M25969</link>
      <description>&lt;P&gt;&lt;STRONG&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8201021"&gt;@BeasterlyJEC92&lt;/a&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Have you assigned a column name of a object type string to the variable col? At the moment you have a variable set to another vairable&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Col&lt;/SPAN&gt; = &lt;SPAN&gt;Col_Name&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;If you don’t find the parameter name in the excel sheet the code should &amp;nbsp;return -1 and you can use this in an if statement along with a continue for line to move to next parameter.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 00:27:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11824626#M25969</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2023-03-16T00:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data for parameters from spreadsheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11825392#M25970</link>
      <description>&lt;P&gt;the long way to do this would be to use goExcel.Cellvalue instead.&lt;/P&gt;&lt;P&gt;example could be&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parameter(parameter) = GoExcel.CellValue&lt;/P&gt;&lt;P&gt;then do that for all your parameters. its bothersome to do it this way, but it will help you specify exactly what you want to change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;note: are you sure that your sketches are fully constrained? the "d" parameters aren't a parameter you've named, so it could be that inventor adjusts those values because of how you change values of dimensions you've named.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 09:44:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11825392#M25970</guid>
      <dc:creator>op_thorsager</dc:creator>
      <dc:date>2023-03-16T09:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling data for parameters from spreadsheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11825888#M25971</link>
      <description>&lt;P&gt;Your a absolute genius, thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:04:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pulling-data-for-parameters-from-spreadsheet/m-p/11825888#M25971</guid>
      <dc:creator>BeasterlyJEC92</dc:creator>
      <dc:date>2023-03-16T13:04:09Z</dc:date>
    </item>
  </channel>
</rss>

