Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Parameter Syntax Help

oregondunerz
Participant Participant
244 Views
2 Replies
Message 1 of 3

Parameter Syntax Help

oregondunerz
Participant
Participant

Good morning.  I am trying to design a parametric tab and slot box and I am running in to an expression syntax error - the expression is shown in 'red' color and I cannot click OK.  I think I am close, but for the life of me I cannot figure this out.

 

I have 3 different parameter;

- myWidth = 4"

-myFinger = .75"

-nInstancesW = if (myWidth <= 4) then 2 else (floor(myWidth / myFinger))

 

Then, in my rectangular pattern dialogue;

-Quantity = nInstancesW / 2

Distance = myWidth - myFinger * 3

 

Essentially what I am trying to accomplish is if the width of my box is less than or equal to 4" than I only want to have 2 instances of my rectangular pattern (the tabs).  See image attached for reference.  The middle finger is the one I am trying not to include if the 'myWidth' is less than or equal to 4.  Hope this makes sense and hopefully I am close to the proper solution.  I feel like it may just be a syntax error but I have tried several different methods and getting the same result.  --and yes I am aware that there are websites to general this sort of tab and slot box but it's important for me to learn how to do it myself.  Thanks for any help!

0 Likes
Accepted solutions (1)
245 Views
2 Replies
Replies (2)
Message 2 of 3

JoshuaOrr
Enthusiast
Enthusiast
Accepted solution

1. The syntax for the "if" function is:

 

 

 

if(<condition>;<then>;<else>)

 

 

 

so you would write

 

 

 

if(myWidth <= 4";2;(floor(myWidth/myFinger)))

 

 

 

I have this page bookmarked because I forget every few days: https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-76272551-3275-46C4-AE4D-10D58B408C20 

 

2. Another issue can come from trying to put a non-integer into the "Count" field of a pattern feature. It looks to me like your current expression could result in a decimal if "nInstances" is odd, so you may have to include another round/floor/ceil function after you divide by 2.

0 Likes
Message 3 of 3

oregondunerz
Participant
Participant

That worked PERFECTLY!  Ugh, I absolutely hate getting stuck on 'easy' stuff like this for hours, thanks again for all the help!

0 Likes