Hi, below is an example of a code that creates a custom parameter in a file.
I think the answer to what you ask is in the red line of the code
Dim ParamName As String = "A1"
ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.AddByExpression(ParamName, "100", "mm")
oParam = ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.Item(ParamName)'get the parameter
oParam.ExposedAsProperty = True'export the paramter as an iProperty
oParam.CustomPropertyFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType'kNumberPropertyType
oParam.CustomPropertyFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision'kThreeDecimalPlacesPrecision
oParam.CustomPropertyFormat.ShowUnitsString=False
oParam.CustomPropertyFormat.ShowTrailingZeros = False
oParam.CustomPropertyFormat.ShowLeadingZeros = False
I hope this helps greetings
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn