Rounding the parameters from the userform.

Rounding the parameters from the userform.

Anonymous
Not applicable
653 Views
4 Replies
Message 1 of 5

Rounding the parameters from the userform.

Anonymous
Not applicable

Hello community,

I am designing a cabinet which is parametric in widths. The width is a multi-value list and the form has values in inches. However, I want to give my model the value which is rounded in mm.

For examples,

for 18" cabinet, the cabinet width will be 457 mm.

shshreys_0-1615563000510.png

 

Will an iLogic rule help me to create that?

 

Thank you in advance.

0 Likes
Accepted solutions (1)
654 Views
4 Replies
Replies (4)
Message 2 of 5

J-Camper
Advisor
Advisor
Accepted solution

As long as your "Cabinet Width" Field is not directly feeding the part width, you can just round to the nearest mm at the parameter itself:

temp_pic.JPG

Parameter("inch_units") = 18 in
Parameter("mm_units") = round(inch_units / 1 mm) * 1 mm

 

Message 3 of 5

WCrihfield
Mentor
Mentor

No. You won't need to use any iLogic.  You can simply create two different UserParameters for the width.  One in inches "Cabinet_Width_in", and the other in millimeters "Cabinet_Width_mm".  Then set the Units of each accordingly.  Then if you want the Inches parameter to be dominant (driving), then within the 'equation' area of the millimeter parameter, put (Cabinet_Width_in * 25.4).  Then it will evaluate the inches parameter to millimeters for you.  In the form, you can change the label/display name of the parameter to eliminate the underscore (_) and the (_in) or the (_mm).  (abs(Cabinet_Width_in * 254 mm)

 

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

EESignature

(Not an Autodesk Employee)

Message 4 of 5

Anonymous
Not applicable

Hi @J-Camper ,

 

That was so easy. Thank you for the help.

0 Likes
Message 5 of 5

NachoShaw
Advisor
Advisor

Also

 

The Parameter itself wont take a Round function so if you still need to round to a whole number, you can use floor & ceil in the parameter-

 

floor(MyParamLength) = round down

ceil(MyParamLength) =round up

 

note: capitalization is important, these 2 parameter functions are not capitalized

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes