Hide Table of Contents

Defining Dimensional Constraints Parameters

You can control Dimensional Constraint geometry with mathematical equations and expressions.

Parametric equations include:

  • The names of the Dimensional Constraints
  • Expressions, in which you can use:
    • Values
    • User-defined variables, and variables that represent existing Dimensional Constraints
    • Mathematical operators, functions, and constants

Expressions for Dimensional Constraints

When you create a Dimensional Constraint, an equation defines the dimension of an entity or between points on entities in the form name=value, for example d1=12.34.

You can replace the value by an expression: name=expression.

  • Within the expression, you can use values, variables, mathematical operators, and mathematical functions and constants.
  • The result of an expression is a value.

A variable can be one of the following:

  • User-defined, for example length1=12.5
  • An existing Dimensional Constraint name, for example d2=rad1

Use the Parameters Manager to define and edit expressions and variables.

You can also edit expressions in-place.

Dimensional Constraints Equation Examples
Example Description
d1=rad1 Sets the variable d1 to the value of the variable rad1.
d2=rad2*2 Multiplies the variable rad2 by 2 and sets the variable d2 as the result.
length1=cos(ang1) Sets the user-defined variable length1 to the value of the cosine of angle ang1.
dist1=(length1 + d1) / 2 Sets the user-defined variable dist1 to the sum of the user-defined variable length1 and the variable d1 divided by 2.

 

Constraint Names

Dimensional Constraints (both Dynamic and Annotation constraints) are identified by name, as well as user-defined variables used in expressions and formulas.

The Parameters Manager lists all Dimensional Constraints variables with their names, expressions, and values.

The naming conventions are:

Meaning Default Name Constraints
Distance d1, d2, ..., dn Aligned, Horizontal, Vertical
Diameter dia1, dia2, ..., dian Diameter
Radius rad1, rad2, ..., radn Radial
Angle ang1, ang2, ..., angn Angular
User-defined user1, user2, ..., usern Used in expressions

 

To rename constraint variable names:

  1. Specify a Dimensional Constraint.
  2. In the Properties palette, under Constraint, edit the Name.

- or -

  1. Specify a Dimensional Constraint.
  2. In the Parameter Manager palette, under Dimensional Constraints, edit the Name.

- or -

  1. Double-click a Dimensional Constraint.
  2. Edit the variable name in place.

Note: Constraint variable names must be unique.

Parametric Equations

Use operators and functions to define formulas and equations.

The evaluation of expressions follows standard mathematical rules.

Operators

You can use the following operators in expressions and formulas:

Operator
Description
+
Addition
-
Subtraction (or unary negation)
*
Multiplication
/
Division
^
Exponentiation
%
Floating point modulo
.
Decimal separator
(expr)
Parentheses to define expressions

 

Functions

You can use the following functions in expressions and formulas:

Function Syntax
Cosine cos (expr)
Sine sin (expr)
Tangent tan (expr)
Arc cosine acos (expr)
Arc sine asin (expr)
Arc tangent atan (expr)
Hyperbolic cosine cosh (expr)
Hyperbolic sine sinh (expr)
Hyperbolic tangent tanh (expr)
Arc hyperbolic cosine acosh (expr)
Arc hyperbolic sine asinh (expr)
Arc hyperbolic tangent atanh (expr)
Square root sqrt (expr)
Signum function (-1,0,1) sign (expr)
Absolute value abs (expr)
Truncate decimal trunc (expr)
Round to nearest integer round (expr)
Round down floor (expr)
Round up ceil (expr)
Largest element in array max (expr1;expr2) *
Smallest element in array min (expr1;expr2) *
Degrees to radians d2r (expr)
Radians to degrees r2d (expr)
Logarithm, base e ln (expr)
Logarithm, base 10 log (expr)
Exponent, base e exp (expr)
Exponent, base 10 exp10 (expr)
Power function pow (expr1;expr2) *
Random decimal, 0-1 random
Constant pi pi
Constant e e

 

*) Uses the list separator (semicolon or comma) as defined in the OS format settings.

^ Top of Page

Expression Evaluation

According to standard mathematical rules expressions are evaluated using the following precedence:

  1. Expressions within parentheses (innermost parentheses first)
  2. Standard operations order:
    1. Exponents
    2. Multiplication and division
    3. Addition and subtraction
  3. Operators of equal precedence from left to right.


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:   Defining Dimensional Constraints Parameters
*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: 2019 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.