<?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 Betreff: Ilogic read csv file in as variables in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10686512#M130016</link>
    <description>&lt;P&gt;That rule was only to show how you can read csv files not to set them as parameters. The following rule will read the csv and also set the parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;()
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&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: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt;.
        &lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;UserParameters&lt;/SPAN&gt;

    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;ReadCSV&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"c:\temp\test.csv"&lt;/SPAN&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;item&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;KeyValuePair&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt;
        &lt;SPAN style="color: #800000;"&gt;SetParameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;item&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Key&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;item&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ReadCSV&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;fileName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;splitChar&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;","&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) = &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)()

    &lt;SPAN style="color: #ff0000;"&gt;Using&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;reader&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;StreamReader&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"c:\temp\test.csv"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Text&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Encoding&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Default&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;reader&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ReadLine&lt;/SPAN&gt;

        &lt;SPAN style="color: #ff0000;"&gt;Do&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;While&lt;/SPAN&gt; (&lt;SPAN style="color: #ff0000;"&gt;Not&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Nothing&lt;/SPAN&gt;)
            &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
                &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;splittedLine&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;() = &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Split&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;splitChar&lt;/SPAN&gt;)
                &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;splittedLine&lt;/SPAN&gt;(0), &lt;SPAN style="color: #800000;"&gt;splittedLine&lt;/SPAN&gt;(1))
            &lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ex&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Exception&lt;/SPAN&gt;
                &lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Could not add data from line: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt;)
            &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
            &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;reader&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ReadLine&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;Loop&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Using&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;SetParameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameters&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;expresion&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;foundPara&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Cast&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameter&lt;/SPAN&gt;).
        &lt;SPAN style="color: #800000;"&gt;Where&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;p&lt;/SPAN&gt;)
                  &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;p&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Equals&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt;)
              &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;FirstOrDefault&lt;/SPAN&gt;()

    &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #800000;"&gt;foundPara&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Nothing&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;expresion&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"mm"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: #800000;"&gt;foundPara&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Expression&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;expresion&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Oct 2021 19:19:37 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2021-10-13T19:19:37Z</dc:date>
    <item>
      <title>Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/9112401#M102522</link>
      <description>&lt;P&gt;&lt;EM&gt;I am reading in a 2 line csv file. The first line contains strings representing variables and the second line, the values.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;my question is, how do you read these in creating iLogic variables of each pair?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ie csv contains:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;length. Width&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1000. &amp;nbsp; &amp;nbsp; 500&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;i want ilogic variables of length and width created with the relevant values.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;many thanks in advance&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Dave&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 14:06:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/9112401#M102522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-28T14:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/9113120#M102534</link>
      <description>&lt;P&gt;you could try the following:&lt;/P&gt;&lt;PRE&gt;Dim splitChar As String = ","
Dim keyLine As String
Dim valLine As String

Using reader As New IO.StreamReader("c:\temp\test.csv", Text.Encoding.Default)
    keyLine = reader.ReadLine()
    valLine = reader.ReadLine()
End Using

Dim keys As String() = keyLine.Split(splitChar)
Dim vals As String() = valLine.Split(splitChar)

Dim csvData As Dictionary(Of String, String) = New Dictionary(Of String, String)()
For i = 0 To keys.Count - 1
    csvData.Add(keys(i), vals(i))
Next

For Each item As KeyValuePair(Of String, String) In csvData
    MsgBox(item.Key &amp;amp; ": " &amp;amp; item.Value)
Next&lt;/PRE&gt;&lt;P&gt;This will fail if the number of key and values are not the same. If you have control over how the csv file is made i would advice you to setup different. its better tou put a key/value pair on each line. like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;length,1000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Width,&lt;/EM&gt;&lt;EM&gt;500&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Its more easy to read and the following iLogic rule will not fail enterly when a line is not correct.&lt;/P&gt;&lt;PRE&gt;Dim splitChar As String = ","
        Dim csvData As Dictionary(Of String, String) = New Dictionary(Of String, String)()

        Using reader As New IO.StreamReader("c:\temp\test.csv", Text.Encoding.Default)
            Dim line As String = reader.ReadLine

            Do While (Not line Is Nothing)
                Try
                    Dim splittedLine As String() = line.Split(splitChar)
                    csvData.Add(splittedLine(0), splittedLine(1))
                Catch ex As Exception
                    MsgBox("Could not add data from line: " &amp;amp; line)
                End Try
                line = reader.ReadLine
            Loop
        End Using

        For Each item As KeyValuePair(Of String, String) In csvData
            MsgBox(item.Key &amp;amp; ": " &amp;amp; item.Value)
        Next&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Oct 2019 19:21:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/9113120#M102534</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-10-28T19:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/9773912#M116420</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this usefull code!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it also possible to create an InputListBox&amp;nbsp; with an array of values read from a CSV file?&lt;/P&gt;&lt;P&gt;I want to fill in 2 custom Props; material and number by select the correct material from an inputListbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my csv file looks like this:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Number, Material&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;1000, Steel&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2000, Wood&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I know this is possible with an XLS file, but this has a slower read performance because ilogic has to start Excel in the background.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:58:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/9773912#M116420</guid>
      <dc:creator>stijnkimpe</dc:creator>
      <dc:date>2020-09-29T08:58:52Z</dc:date>
    </item>
    <item>
      <title>Betreff: Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10685384#M129993</link>
      <description>&lt;P&gt;Hallo,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;by searching for a way to read values from a csv to create Inventor parameters I found this posting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a csv file that contains the parameter names and the values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try the second code from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;A Messegebox show me the pairs but not parameters are created.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do I wrong or is it not possible to create Inventor Parameter from a csv-file&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 11:08:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10685384#M129993</guid>
      <dc:creator>j_weber</dc:creator>
      <dc:date>2021-10-13T11:08:06Z</dc:date>
    </item>
    <item>
      <title>Betreff: Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10686512#M130016</link>
      <description>&lt;P&gt;That rule was only to show how you can read csv files not to set them as parameters. The following rule will read the csv and also set the parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;()
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&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: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameters&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt;.
        &lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;UserParameters&lt;/SPAN&gt;

    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;ReadCSV&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"c:\temp\test.csv"&lt;/SPAN&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;item&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;KeyValuePair&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt;
        &lt;SPAN style="color: #800000;"&gt;SetParameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;item&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Key&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;item&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ReadCSV&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;fileName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;splitChar&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;","&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;) = &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)()

    &lt;SPAN style="color: #ff0000;"&gt;Using&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;reader&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;IO&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;StreamReader&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"c:\temp\test.csv"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;Text&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Encoding&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Default&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;reader&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ReadLine&lt;/SPAN&gt;

        &lt;SPAN style="color: #ff0000;"&gt;Do&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;While&lt;/SPAN&gt; (&lt;SPAN style="color: #ff0000;"&gt;Not&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Nothing&lt;/SPAN&gt;)
            &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
                &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;splittedLine&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;() = &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Split&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;splitChar&lt;/SPAN&gt;)
                &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;splittedLine&lt;/SPAN&gt;(0), &lt;SPAN style="color: #800000;"&gt;splittedLine&lt;/SPAN&gt;(1))
            &lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;ex&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Exception&lt;/SPAN&gt;
                &lt;SPAN style="color: #800000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Could not add data from line: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt;)
            &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
            &lt;SPAN style="color: #800000;"&gt;line&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;reader&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ReadLine&lt;/SPAN&gt;
        &lt;SPAN style="color: #ff0000;"&gt;Loop&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Using&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;csvData&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;SetParameter&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameters&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;expresion&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;foundPara&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameter&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Cast&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;UserParameter&lt;/SPAN&gt;).
        &lt;SPAN style="color: #800000;"&gt;Where&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;p&lt;/SPAN&gt;)
                  &lt;SPAN style="color: #ff0000;"&gt;Return&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;p&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Equals&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt;)
              &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Function&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;FirstOrDefault&lt;/SPAN&gt;()

    &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #800000;"&gt;foundPara&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Nothing&lt;/SPAN&gt;) &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: #800000;"&gt;userParameters&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByExpression&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;name&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;expresion&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"mm"&lt;/SPAN&gt;)
    &lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: #800000;"&gt;foundPara&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Expression&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;expresion&lt;/SPAN&gt;
    &lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Oct 2021 19:19:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10686512#M130016</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-10-13T19:19:37Z</dc:date>
    </item>
    <item>
      <title>Betreff: Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10690068#M130098</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;for your answer and the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try it as fast as I can.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;by&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 06:49:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10690068#M130098</guid>
      <dc:creator>j_weber</dc:creator>
      <dc:date>2021-10-15T06:49:36Z</dc:date>
    </item>
    <item>
      <title>Betreff: Ilogic read csv file in as variables</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10692325#M130165</link>
      <description>&lt;P&gt;Hallo&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it works great for me. Thanks a lot for help&lt;/P&gt;</description>
      <pubDate>Sat, 16 Oct 2021 07:39:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-read-csv-file-in-as-variables/m-p/10692325#M130165</guid>
      <dc:creator>j_weber</dc:creator>
      <dc:date>2021-10-16T07:39:03Z</dc:date>
    </item>
  </channel>
</rss>

