<?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: Creating User Parameter with a Rule in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725091#M115466</link>
    <description>&lt;P&gt;I'm quite new with iLogics I've played around with it a bit, My programming skils are not that great so if you'd like to help that would be great :). I just like to creat a few Parameters like Length, Width, Height etc. and then I'd lik to add these Parameters to a global form which auromatically pops up when creating a new document that last part i've done now only the creation of the parameters&lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2020 12:26:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-02T12:26:04Z</dc:date>
    <item>
      <title>Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725006#M115458</link>
      <description>&lt;P&gt;Is there a way to automatically create one or more Parameters with a rule so that when i create a new part or assembly I automatically always have a set of parameters.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 11:38:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725006#M115458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T11:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725016#M115459</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is there a way to automatically create one or more Parameters with a rule so that when i create a new part or assembly I automatically always have a set of parameters.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sure..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also just add those parameters to your template files so they are always there upon starting a new file from those templates.&amp;nbsp; No coding required for that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is help on how to create new custom templates (you can also just modify the existing ones)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/inventor/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/Inventor-Help/files/GUID-598A0524-BEF9-4F48-8650-69372D5E7CFE-htm.html" target="_blank"&gt;https://knowledge.autodesk.com/support/inventor/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/Inventor-Help/files/GUID-598A0524-BEF9-4F48-8650-69372D5E7CFE-htm.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is some help on creating user parameters via ilogic&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-DB91F7F6-842C-4849-A856-1003F8B7C576" target="_blank"&gt;https://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-DB91F7F6-842C-4849-A856-1003F8B7C576&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know if you need additional help and be specific&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 11:52:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725016#M115459</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2020-09-02T11:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725024#M115461</link>
      <description>&lt;P&gt;I can't change the templates that's above my pay grade &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 11:49:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725024#M115461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T11:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725030#M115462</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I can't change the templates that's above my pay grade &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;um... ok..&lt;/P&gt;
&lt;P&gt;How much experience do you have with ilogic?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you be specific about what parameters you would like to create?&lt;/P&gt;
&lt;P&gt;Do you need us to write this rule for you or will the link I posted above be sufficient?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 11:54:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725030#M115462</guid>
      <dc:creator>mcgyvr</dc:creator>
      <dc:date>2020-09-02T11:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725091#M115466</link>
      <description>&lt;P&gt;I'm quite new with iLogics I've played around with it a bit, My programming skils are not that great so if you'd like to help that would be great :). I just like to creat a few Parameters like Length, Width, Height etc. and then I'd lik to add these Parameters to a global form which auromatically pops up when creating a new document that last part i've done now only the creation of the parameters&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 12:26:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9725091#M115466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T12:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9726100#M115482</link>
      <description>&lt;P&gt;I put together a little sample of how you can add different types of User Parameters:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'Access User parameters of the active document
Dim oMyParameters As UserParameters = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters 
'Create list of Parameter names of type: number
Dim numParams As New List(Of String) 
numParams.AddRange({"Height", "Length", "Thickness"})
'Create list of Parameter names of type: text
Dim textParams As New List(Of String) 
textParams.AddRange({"Name", "Side", "Orientation"})
'Create list of Parameter names of type: True/False
Dim booleanParams As New List(Of String) 
booleanParams.AddRange({"Two_Side_Machining", "Buyout"})
'Testing and Creation of User Parameters of type: number
For Each item In numParams
	Try 'Check if User Parameter exists
		Param = oMyParameters.Item(item)
	Catch 'Parameter doesn't exist as a User Parameter
		Try 'attempt to create new parameter
			oMyParameters.AddByExpression(item, 0, UnitsTypeEnum.kInchLengthUnits) '(Name, Value, Unit Type)
		Catch 'Parameter exists but not as a User Parameter
			MessageBox.Show("The Parameter: " &amp;amp; item &amp;amp; " exists as a parameter, but is not a user parameter.", "Creation Failure")
		End Try
	End Try
Next
'Testing and Creation of User Parameters of type: text
For Each item In textParams
	Try 'Check if User Parameter exists
		Param = oMyParameters.Item(item)
	Catch 'Parameter doesn't exist as a User Parameter
		Try 'attempt to create new parameter
			oMyParameters.AddByValue(item, "filler", UnitsTypeEnum.kTextUnits) '(Name, Value, Unit Type)
		Catch 'Parameter exists but not as a User Parameter
			MessageBox.Show("The Parameter: " &amp;amp; item &amp;amp; " exists as a parameter, but is not a user parameter.", "Creation Failure")
		End Try
	End Try
Next
'Testing and Creation of User Parameters of type: True/False
For Each item In booleanParams
	Try 'Check if User Parameter exists
		Param = oMyParameters.Item(item)
	Catch 'Parameter doesn't exist as a User Parameter
		Try 'attempt to create new parameter
			oMyParameters.AddByValue(item, True, UnitsTypeEnum.kBooleanUnits) '(Name, Value, Unit Type)
		Catch 'Parameter exists but not as a User Parameter
			MessageBox.Show("The Parameter: " &amp;amp; item &amp;amp; " exists as a parameter, but is not a user parameter.", "Creation Failure")
		End Try
	End Try
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I tried to add enough comments to help you understand what is happening so you can modify as needed.&amp;nbsp; Let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 19:41:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9726100#M115482</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2020-09-02T19:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating User Parameter with a Rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9729708#M115556</link>
      <description>&lt;P&gt;Thank you very much this will do for what I want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 12:44:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/creating-user-parameter-with-a-rule/m-p/9729708#M115556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-04T12:44:43Z</dc:date>
    </item>
  </channel>
</rss>

