Announcements
Visit Fusion 360 Feedback Hub, the great way to connect to our Product, UX, and Research teams. See you there!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Conditional Parameters: If Then Else

Conditional Parameters: If Then Else

The more we use parameters to drive our design work in F360, the more we wish for conditional logic. There aren't many workarounds to having conditional statements in parameters.

 

I'd love to be able to set parameters like:

 

HoleWidth= 24 in

Width = 60 in

MinHoles = 2

HoleCount = if(Width / HoleWidth <2 then 2 else Width / HoleWidth)

 

Another desire with rectangular patterns:

 

We define the length, width, hole size, and spacing for a pattern of holes in a flat 2D design. We can quickly change the length and width and keep those patterned holes centered, BUT we can't have the 

Won't accept a unit based referenceWon't accept a unit based reference

pattern fill the space as it changes size. We have to change the actual quantity of the X and Y repetition in the pattern because the parameter system won't allow a unit-based reference to calculate in a No Unit field.

 

Confounding this, you can't use a parameter that has a unit in the Quantity field of a Pattern. 🤦‍:male_sign: This seems like an easy fix - just allow that parameter in the quantity field and forget that it has units.

 

 

 

holeCount has unitsholeCount has units

Conditional logic is fairly elementary in scripting and would be a huge boon to the capabilities for parametric design software like Fusion 360.

 

 

 

 

 

Inventor and Revit have If Then Else, can we port that over, pretty please?

 

 

2 Comments
morrijr
Explorer

Hi,

 

I like the idea (and I've voted for it), but there's a math 'trick' you might be able to use to help you.

 

if(Width / HoleWidth <2 then 2 else Width / HoleWidth)

 

can be written as

 

Math.max(Width / HoleWidth, 2)

 

What this is doing is effectively clipping the lower bound to 2.

 

You can also use Math.min in the opposite case where you want to clip the upper bound.

 

Hope that helps! Can't do anything about the No Units issue apart from perhaps creating a No Unit as your number and another parameter which is equal to the No Unit with a unit. Hum. Perhaps an example might help.

 

Length = 200

Length_mm = $Length mm

 

Thoughts?

jbrewlet
Enthusiast

@morrijr - thanks for the suggestion. This is a nice way to do some form of conditional work.

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report