<?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 Trim parameter from Trailing zeros in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10126803#M52570</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same problem as this guy:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/trim-parameter-values-for-trailing-zeros/td-p/5360379" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/trim-parameter-values-for-trailing-zeros/td-p/5360379&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code to round up parameters with the unit "mm" to be whole numbers. This is important in our assets for the BOM list in the end.&amp;nbsp; I use the following code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;UserParams&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserParameters&lt;/SPAN&gt;
&lt;SPAN&gt;UserParams&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;UserParameters&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;Item&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;UserParams&lt;/SPAN&gt;
	 	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;Units&lt;/SPAN&gt; = &lt;SPAN&gt;"mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;Ceil&lt;/SPAN&gt;(&lt;SPAN&gt;Item&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;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in the parameters getting&amp;nbsp;x,00000000 mm behind it. This is very confusing for the end user that uses the assets/parameters. How do i get rid of the zeroes?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Mar 2021 14:31:27 GMT</pubDate>
    <dc:creator>reggie.mostert</dc:creator>
    <dc:date>2021-03-03T14:31:27Z</dc:date>
    <item>
      <title>Trim parameter from Trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10126803#M52570</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same problem as this guy:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/trim-parameter-values-for-trailing-zeros/td-p/5360379" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/trim-parameter-values-for-trailing-zeros/td-p/5360379&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code to round up parameters with the unit "mm" to be whole numbers. This is important in our assets for the BOM list in the end.&amp;nbsp; I use the following code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;UserParams&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserParameters&lt;/SPAN&gt;
&lt;SPAN&gt;UserParams&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;UserParameters&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;Item&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;UserParams&lt;/SPAN&gt;
	 	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;Units&lt;/SPAN&gt; = &lt;SPAN&gt;"mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;Ceil&lt;/SPAN&gt;(&lt;SPAN&gt;Item&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;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in the parameters getting&amp;nbsp;x,00000000 mm behind it. This is very confusing for the end user that uses the assets/parameters. How do i get rid of the zeroes?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 14:31:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10126803#M52570</guid>
      <dc:creator>reggie.mostert</dc:creator>
      <dc:date>2021-03-03T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trim parameter from Trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10127214#M52571</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Dim UserParams As UserParameters
Dim p As Inventor.PartDocument = ThisApplication.ActiveDocument

UserParams = p.ComponentDefinition.Parameters.UserParameters
Dim item As Inventor.Parameter

'Ceil()
For Each item In UserParams
	 	If item.Units = "mm" Then
			
			'MsgBox (item.modelvalue)
			item.Value = Ceil(item.Value*10)/10
		End If
Next&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 16:34:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10127214#M52571</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2021-03-03T16:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trim parameter from Trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10128792#M52572</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7511028"&gt;@reggie.mostert&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using iLogic try the below code and see if this gives you the result you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;UserParams&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserParameters&lt;/SPAN&gt;
&lt;SPAN&gt;UserParams&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;UserParameters&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;Item&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;UserParams&lt;/SPAN&gt;
	 	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;Units&lt;/SPAN&gt; = &lt;SPAN&gt;"mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;x&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;Ceil&lt;/SPAN&gt;(&lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;)
			 &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;Item&lt;/SPAN&gt;.&lt;SPAN&gt;name&lt;/SPAN&gt;) = &lt;SPAN&gt;x&lt;/SPAN&gt;*10
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;RuleParametersOutput&lt;/SPAN&gt;
&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentUpdate&lt;/SPAN&gt;()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 06:05:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10128792#M52572</guid>
      <dc:creator>dutt.thakar</dc:creator>
      <dc:date>2021-03-04T06:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trim parameter from Trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10128863#M52573</link>
      <description>&lt;P&gt;Thanks guys! The code from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6518271"&gt;@dutt.thakar&lt;/a&gt;&amp;nbsp;worked fine. thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 06:58:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trim-parameter-from-trailing-zeros/m-p/10128863#M52573</guid>
      <dc:creator>reggie.mostert</dc:creator>
      <dc:date>2021-03-04T06:58:59Z</dc:date>
    </item>
  </channel>
</rss>

