Hi @M_Santi. When setting up your 'Custom Property Format' settings manually, as shown in your image...if you leave the 'Units' set to 'Text', then you can simply un-check the checkbox next to the 'Leading Zeros' setting. But if you change the 'Units' to Number, instead of Text, then the leading zero is already being removed, by default. There are ways to set all of those same settings by code too, if you would prefer to do it that way. I assume that these source parameters have been created directly within the drawing document then, right?
Here is an iLogic rule you can try out. This rule will ensure that those parameters exist, and are set to the values, units, and custom property format settings that you want.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oParamsToCreate As New List(Of String())
oParamsToCreate.Add({"AREA", ".29878 in^2", "in^2"})
oParamsToCreate.Add({"MASS", ".358 lbmass", "lbmass"})
Dim oUParams As UserParameters = oDDoc.Parameters.UserParameters
Dim oUParam As UserParameter = Nothing
For Each Entry In oParamsToCreate
Dim oName As String = Entry(0)
Dim oExpression As String = Entry(1)
Dim oUnits As String = Entry(2)
Try
oUParam = oUParams.Item(oName)
oUParam.Units = oUnits
oUParam.Expression = oExpression
Catch
oUParam = oUParams.AddByExpression(oName, oExpression, oUnits)
End Try
Try
oUParam.ExposedAsProperty = True
Dim oCPF As CustomPropertyFormat = oUParam.CustomPropertyFormat
oCPF.PropertyType = CustomPropertyTypeEnum.kTextPropertyType
oCPF.Units = oUParam.Units
oCPF.Precision = CustomPropertyPrecisionEnum.kThreeDecimalPlacesPrecision
oCPF.ShowUnitsString = False
oCPF.ShowLeadingZeros = False
oCPF.ShowTrailingZeros = True
Catch : End Try
Next
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)