Hi DRoam, sorry that this is dragging on, but an issue still persists.
If I add anything to 2 decimal places, the filed is converted to text.
I have no idea.
This is the code:
Dim Vendor_Price As Double = iPropGetStr("Vendor_Price", 0.0000)
I want the price format to be up to 4 decimal places.
To test this, I make sure that there is no custom iProp called Vendor_Price.

After running the rule, the form I have created is loaded:

The format is to 1 decimal place, but still a number:

So I load the custom form & add a price:

But when I check the custom iProp, it's now text:

What am I doing wrong?
For reference, this is the whole code in the rule:
Sub Main()
Dim iFileName As String
iFileName=ThisDoc.FileName(False) 'without extension
iProperties.Value("Custom", "File_Name") = iFileName
Dim Part_Description As String = iPropGetStr("Part_Description","Enter Part Description")
Dim Part_Nº As String = iPropGetStr("Part_Nº","Enter Part Nº")
Dim Manufacturer As String = iPropGetStr("Manufacturer","Enter Manufacturer")
Dim Vendor_Part_Nº As String = iPropGetStr("Vendor_Part_Nº", "Enter Vendor Part Nº")
Dim Vendor_Price As Double = iPropGetStr("Vendor_Price", 0.0000)
iLogicForm.Show("Document Properties")
End Sub
Function iPropGetStr(PropName As String, Optional MissingSetVal As Object = "", Optional Doc As Inventor.Document = Nothing) As Object
If Doc Is Nothing Then Doc = ThisDoc.Document
Dim CustomPropSet As Inventor.PropertySet = Doc.PropertySets.Item("Inventor User Defined Properties")
Try
Dim CurrentValue As Object = CustomPropSet.Item(PropName).Value
Return CurrentValue
Catch
Dim oTransaction As Inventor.Transaction
Try
oTransaction = ThisApplication.TransactionManager.StartTransaction(Doc,"Create property """ & PropName & """")
CustomPropSet.Add(MissingSetVal, PropName)
oTransaction.End
Return MissingSetVal 'Successfully created/set.
Catch
If Not oTransaction Is Nothing Then oTransaction.Abort
Return -1 'Unable to create.
End Try
Return MissingSetVal
End Try
End Function