Community
Fusion Design, Validate & Document
Stuck on a workflow? Have a tricky question about a Fusion (formerly Fusion 360) feature? Share your project, tips and tricks, ask questions, and get advice from the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IF statements, even or odd values

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Fully_Defined
338 Views, 7 Replies

IF statements, even or odd values

I don't see any mention of how Fusion treats even/odd values in IF statements, here. Am I looking in the wrong place?

 

I need a parameter for a feature pattern that offsets the seed to a different location depending on if it has an even or odd number of instances along a particular axis.

 

I am aware that there are alternative (possibly better!) means to the same end, but this question is about even and odd values in IF statements. I just want to know if there is an intended workflow or workaround to use it in logic in Fusion.

 

Are there more operators than what is shown in the link above?

7 REPLIES 7
Message 2 of 8

Take a look at this model where I determine the placement of partitions using a test for even or odd on the partition placement.  If the placement is even, the Joint Offset value is applied, if it is odd, it is not.  I too could not find an direct statement to determine even or odd so I created a little test then applied the test to an If statement.  There are two of these tests in the model, one for each partition direction.  Model is attached.

 

Even or Odd.jpg

 

 


"If you find my answer solved your question, please select the Accept Solution icon"

John Hackney
Retired

Beyond the Drafting Board


Message 3 of 8
MRWakefield
in reply to: Fully_Defined

You could use the "Modulo" operator with a value of "2" as the divisor:

 

MRWakefield_0-1720304651203.png

 

If this answers your question please mark the thread as solved as it can help others find solutions in the future.
Marcus Wakefield

___________________________________________________________________________________________________________
I've created a Windows application for creating custom thread files for Fusion. You can find out about it here. Hope you find it useful.
___________________________________________________________________________________________________________

Message 4 of 8

I like this. If after the value is divided by two and rounded up, and the rounding figure is larger than the original figure divided by two, then it is odd. That works well for whole integers, which is all I would use for a number of instances in a pattern.

 

Thumbs up!

 

My fear was that null values for length isn't allowed in Fusion, but you clearly are using it here. Nice!

 


@jhackney1972 wrote:

Take a look at this model where I determine the placement of partitions using a test for even or odd on the partition placement.  If the placement is even, the Joint Offset value is applied, if it is odd, it is not.  I too could not find an direct statement to determine even or odd so I created a little test then applied the test to an If statement.  There are two of these tests in the model, one for each partition direction.  Model is attached.

 

Even or Odd.jpg

 

 


 

Message 5 of 8
Fully_Defined
in reply to: MRWakefield

This was the answer I was looking for. Thanks!

 

Screenshot 2024-07-06 at 16.06.03.pngScreenshot 2024-07-06 at 16.05.18.png

 


@MRWakefield wrote:

You could use the "Modulo" operator with a value of "2" as the divisor:

 

MRWakefield_0-1720304651203.png

 


 

Message 6 of 8
MRWakefield
in reply to: Fully_Defined

I'm pleased it worked for you 😀

If this answers your question please mark the thread as solved as it can help others find solutions in the future.
Marcus Wakefield

___________________________________________________________________________________________________________
I've created a Windows application for creating custom thread files for Fusion. You can find out about it here. Hope you find it useful.
___________________________________________________________________________________________________________

Message 7 of 8
g-andresen
in reply to: Fully_Defined

Hi,

This also works if modulo is not known.

value_even_odd.png

günther

Message 8 of 8
Fully_Defined
in reply to: g-andresen


@g-andresen wrote:

Hi,

This also works if modulo is not known.

value_even_odd.png

günther


This is also good. Thanks!

 

In the meantime, I found this, which is a lot more information than the page I linked to originally.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report