<?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: Userparameter without trailing zeros in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12366595#M160166</link>
    <description>&lt;P&gt;These codes work fine in Inventor 2022.&lt;/P&gt;
&lt;P&gt;Can you upload your files so that we can check.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are the units all mm units?&lt;/LI&gt;
&lt;LI&gt;Are you using a .ipt file?&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 09 Nov 2023 18:21:46 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2023-11-09T18:21:46Z</dc:date>
    <item>
      <title>Userparameter without trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12365243#M160136</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found this post already&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-programming-ilogic/trim-parameter-from-trailing-zeros/m-p/10127214" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-programming-ilogic/trim-parameter-from-trailing-zeros/m-p/10127214&lt;/A&gt;&amp;nbsp;and tried both code snippets marked as solution, but they don't work for me.&lt;/P&gt;&lt;P&gt;I'm using Inventor Professional 2023.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 10:01:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12365243#M160136</guid>
      <dc:creator>richterBKSAC</dc:creator>
      <dc:date>2023-11-09T10:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Userparameter without trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12366595#M160166</link>
      <description>&lt;P&gt;These codes work fine in Inventor 2022.&lt;/P&gt;
&lt;P&gt;Can you upload your files so that we can check.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are the units all mm units?&lt;/LI&gt;
&lt;LI&gt;Are you using a .ipt file?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 09 Nov 2023 18:21:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12366595#M160166</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-11-09T18:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Userparameter without trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12366679#M160167</link>
      <description>&lt;P&gt;The primary reasons why this is a complex task is that when we access the values of Parameter API objects, that represent values of units other than Text, Boolean, or unitless, is that the values are returned in 'database' units, instead of the units that the parameter is set to.&amp;nbsp; When the units are millimeters, we know that the value we get from the Parameter API object will be in centimeters (not millimeters), so we know that we can simply divide centimeters by 10 to get millimeters.&amp;nbsp; But there are tons of possible units that could be present in any given document, and we do not know how to convert all possible units values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I want to manually change how many trailing zeros I see in the parameters dialog for a specific parameter, I can do one of the following.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If I want more trailing zeros, I re-type the value with the needed number of trailing zeros, except leave the last digit a 1, instead of zero, then after accepting that, I change that last digit from a 1 to a zero.&amp;nbsp; The trailing zeros stay there.&lt;/LI&gt;
&lt;LI&gt;If I want to completely eliminate any trailing zeros, I can simply re-type the value without any trailing zeros.&lt;/LI&gt;
&lt;LI&gt;If there is an equation driving the value, then you generally do not have much control over the value, other than placing the equation within one of the few &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-EE98BCED-5623-4E3B-9E98-432C6738B081" target="_blank" rel="noopener"&gt;allowed parameter functions&lt;/A&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I had attempted this once before too, but gave up on it, because it just wasn't that important to me at the time.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oDoc As Document = ThisDoc.Document
Dim oParams As Inventor.Parameters = Nothing
If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Or
	oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
	oParams = oDoc.ComponentDefinition.Parameters
ElseIf oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
	oParams = oDoc.Parameters
Else
	Return
End If
If oParams.Count = 0 Then Return
Dim oParam As Inventor.Parameter
For Each oParam In oParams
	If oParam.Units = "Text" Or oParam.Units = "Boolean" Or oParam.Units = "ul" Then Continue For
	Dim oVal As Double = 0.0
	Try
		oVal = oParam.Value
		oVal = (oVal * 10) / 10
		oVal = Ceil(oVal)
		oParam.Value = oVal
	Catch
	End Try
Next&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Nov 2023 18:55:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12366679#M160167</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-11-09T18:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Userparameter without trailing zeros</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12405137#M160772</link>
      <description>&lt;P&gt;Thank you for your reply and sorry about the late answer.&lt;/P&gt;&lt;P&gt;I'm using an .ipt and "mm".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So there is no way to fix it via some ilogic code? For my purposes I'm creating the parameters via ilogic but after that the user has to manually link+edit them to modelparameters. It would be nice to have them displayed like a manually created userparameter, but it's gladly no requirement for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although I'm curious on why it worked in the 2022 version, like&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/473476"&gt;@bradeneuropeArthur&lt;/a&gt;&amp;nbsp;mentioned, and not anymore in the 2023 version.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 10:59:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/userparameter-without-trailing-zeros/m-p/12405137#M160772</guid>
      <dc:creator>richterBKSAC</dc:creator>
      <dc:date>2023-11-28T10:59:49Z</dc:date>
    </item>
  </channel>
</rss>

