<?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: Calling an user parameter from strings in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/calling-an-user-parameter-from-strings/m-p/12865238#M168925</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14967915"&gt;@harvey_craig2RCUH&lt;/a&gt;.&amp;nbsp; If you are referring to how we can use the blue, unquoted names of parameters within 'internal' iLogic rules (rules that are saved within Inventor documents), then nothing like that will work, because they will be seen as a String type object by the code processor, not as a Parameter.&amp;nbsp; However, you may be able to do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim string1 As String = "my"
Dim string2 As String = "UserParameter"
Parameter(string1 &amp;amp; string2) = 42&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But doing it this way will not cause the automatic triggering of the rule whenever its value changes.&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; There is also the Inventor API way of getting that UserParameter, then setting its value, based on those two Strings, but its ModelValue &amp;amp; Value Properties Get/Set the value in 'database units' instead of 'document units' or 'parameter units'.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim string1 As String = "my"
Dim string2 As String = "UserParameter"
ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.Item(string1 &amp;amp; string2).Value = 42&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 27 Jun 2024 16:26:21 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2024-06-27T16:26:21Z</dc:date>
    <item>
      <title>Calling an user parameter from strings</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/calling-an-user-parameter-from-strings/m-p/12865205#M168923</link>
      <description>&lt;P&gt;I have simplified this majorly for what I'm trying to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inside Inventor I have a user parameter called myUserParameter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I set it by piecing together the parameter name on the left hand side of the equals sign if I'm bringing it together with strings?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;string1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"my"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;string2&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"UserParameter"&lt;/SPAN&gt;

&lt;SPAN&gt;string1&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;string2&lt;/SPAN&gt; = 42&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 16:05:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/calling-an-user-parameter-from-strings/m-p/12865205#M168923</guid>
      <dc:creator>harvey_craig2RCUH</dc:creator>
      <dc:date>2024-06-27T16:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calling an user parameter from strings</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/calling-an-user-parameter-from-strings/m-p/12865238#M168925</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14967915"&gt;@harvey_craig2RCUH&lt;/a&gt;.&amp;nbsp; If you are referring to how we can use the blue, unquoted names of parameters within 'internal' iLogic rules (rules that are saved within Inventor documents), then nothing like that will work, because they will be seen as a String type object by the code processor, not as a Parameter.&amp;nbsp; However, you may be able to do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim string1 As String = "my"
Dim string2 As String = "UserParameter"
Parameter(string1 &amp;amp; string2) = 42&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But doing it this way will not cause the automatic triggering of the rule whenever its value changes.&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; There is also the Inventor API way of getting that UserParameter, then setting its value, based on those two Strings, but its ModelValue &amp;amp; Value Properties Get/Set the value in 'database units' instead of 'document units' or 'parameter units'.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim string1 As String = "my"
Dim string2 As String = "UserParameter"
ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.Item(string1 &amp;amp; string2).Value = 42&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Jun 2024 16:26:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/calling-an-user-parameter-from-strings/m-p/12865238#M168925</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-06-27T16:26:21Z</dc:date>
    </item>
  </channel>
</rss>

