- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm running into more headaches with managing Parameter values thru iLogic, Autodesk suggested I post this to the Forums since they didn't really have a solution on this they thought someone in the community might.
I'm attempting to use a Parameter to store a user input value, with the U/M in FT (to match the supplied value from an Engineers worksheet). The test value used here is 40.00520833 ft [40'-0 1/16"] with an expected final result value saved to the Parameter as 40.00521 ft.
I want iLogic to take that Parameter value, round it to the nearest 1/16th inch, utilize that value within the iLogic for other tasks, and finally save the modified number back in FT to the Parameter rounded to 5 digits to properly hand off through a BOM Export for use with other existing downstream automation processes that require this format.
So mathematically the process is to take the Parameter value, convert to inches, round to the nearest 16th, convert back to FT and round to 5 places for final storage.
I've created Parameter named "Length", applied this logic, and get several unexpected results. Test code and results I've performed thus far are:
Parameter("Length") = Round(Round(Round(Length * 12 * 16) / 16 / 12 * 100000) / 100000, 5)
MsgBox(Length)
'Parameter("Length") = Round(Round(Length * 12 * 16) / 16 / 12, 5) 'This option loses the fractional result
'Dim oLength As Double = Parameter("Length") 'this variant results in the same as line 1 above
'oLength = Round(Round(oLength / 1 ft * 12 * 16) / 16 / 12 * 1 ft, 5)
'MsgBox(oLength)
'Parameter("Length") = oLength
I've added a text box to display the value of the parameter while utilized within iLogic. Expecting that value to be the formatted result in FT, I am instead receiving the value in inches whether I access the Parameter or use a Variable approach. I don't know if the display isn't keeping pace with the speed of the iLogic routine or if in fact the number is not as expected and any routines I add to utilize the value will be the incorrect U/M and thus give me headaches when processing that value through any additional code for model utilization.
The final result of saving the converted value is also not as expected as the rounding method appears to be completely ignored. The value being stored in the Equation field goes to the nth decimal place instead of the desired 5 decimal places. Additionally, the "Driving Rule" field is blank where it typically shows the rule that is manipulating the value.
Anyone have any suggestions on how to achieve my goals here? Test file attached.
Currently using Inv 2023.4.2

Solved! Go to Solution.