Hide Table of Contents

IF

You can use the arithmetic IF operator to conditionally evaluate a functional expression.

IF (expression 1: expression 2, expression 3, expression 4)

The method evaluates expression 1, and then operates as follows:
  • If the value of expression 1 is less than zero, the arithmetic IF is evaluated using expression 2.
  • If the value of expression 1 is equal to zero, the arithmetic IF is evaluated using expression 3.
  • If the value of expression 1 is greater than zero, the arithmetic IF is evaluated using expression 4.

Format

IF (A: X, Y, Z)

Arguments

A Any valid function expression. The software evaluates the expression to determine which branch of the arithmetic IF <X, Y, Z> is selected.
X Any valid function expression. If the value of the test expression is less than zero, the software evaluates the X expression and the IF function takes on the value of X. Otherwise, the X expression is not evaluated.
Y Any valid function expression. If the value of the test expression is equal to zero, the software evaluates the Y expression and the IF function takes on the value of Y. Otherwise, the Y expression is not evaluated.
Z Any valid function expression. If the value of the test expression is greater than zero, the software evaluates the Z expression and the IF function takes on the value of Z. Otherwise, the Z expression is not evaluated.

Cautions

When using an arithmetic IF function to define motion, make sure that the resulting motion or force is continuous. If the motion or force is discontinuous, the motion simulation may fail to find a solution. It is best if all functions you use to define motion or forces have continuous first and second derivatives. It is best if you do not use the IF function to define motion.



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   IF
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: SOLIDWORKS 2017 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.