Community
Fusion Manufacture
Talk shop with the Fusion (formerly Fusion 360) Manufacture Community. Share tool strategies, tips, get advice and solve problems together with the best minds in the industry.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

if/then, logical AND, OR solution

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
infoXNDBJ
111 Views, 2 Replies

if/then, logical AND, OR solution

I have figured out the nested if/then branching for example

 

GewKern_D > 4.2 ? 1 : (GewKern_D <= 2.5 ? 0.5 : 0.8)

 

if thread diameter > 4.2 then 1 else nested if. it is a kludge for complex nesting because we use at least 5 standard tools...but it works

 

what I didn`t figure out so far is logical operations AND, OR, NOR. I have tried based on https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-76272551-3275-46C4-AE4D-10D58B408C20

 

((GewKern_D > 4.2) and (GewKern_D < 5)) ? 1 : (GewKern_D <= 2.5 ? 0.5 : 0.8)

 

Either there is an error in logic or Fusion360manufacturing extension doesn`t allow logical operations.

 

Any suggestions, please?

 

 

2 REPLIES 2
Message 2 of 3
njdupreez
in reply to: infoXNDBJ

TL;DR: Use &&, ||, ==, !=, ! for logical and, or, equal, not equal and not.

 

If I use the following as the expression of a parameter it seems to work:

 

if(GewKern_D > 4.2 and GewKern_D < 5; 1; if(GewKern_D <= 2.5; 0.5; 0.8))

 

The syntax is:

if( logical_expression ; true_case false_case )

That's straight forward.  However using the same expression above, that works for parameters, to specify e.g. the Surface Feed setting based on the diameter yields an error stating that the expression can not be evaluated.  To get an expression to work use the following syntax:

GewKern_D > 4.2 && GewKern_D < 5 ? 1 : GewKern_D <= 2.5 ? 0.5 : 0.8

So basically use &&, ||, ==, !=, ! for logical and, or, equal, not equal and not..

 

Note that you have to click on the menu button and select "Edit Expression" to change the expression once you have entered it.

 

njdupreez_1-1702894338189.png

 

 

 

Message 3 of 3
infoXNDBJ
in reply to: infoXNDBJ

solution for boolean operations in machining mode

 

 

&&	and
!	not
||	or

 

 

Above by statement would be translated into

 

 

GewKern_D > 4.2 && GewKern_D < 5 ? 1 : GewKern_D <= 2.5; 0.5; 0.8

 

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

Post to forums  

Autodesk Design & Make Report