|
Examples of using expressions |
Scroll |
Example of using algebraic expression
Sketch of a cut-out extrusion element – a circle of diameter d1. The element forms the conical part of a hole. Diameter of the cylindrical part of a hole — d (see Figure b).
|
|
a) |
b) |
Algebraic expression
The depth of extrusion (v13) must be calculated using the formula (see Figure a):
(d1-d)/2*tand(a*2),
where
d, d1 – diameters of cone bases,
a – half angle at the cone vertex.
Example of using a logical expression
The extrusion element which forms a ledge should be present in a model of the flanged elbow if any of the following conditions hold:
•GOST 20189, angle 90°,
•GOST 20190.
To implement this requirement in a model, it is necessary to create the following variables (see the figure):
•which sets the number of standard, for example, GOST,
•which sets the value of angle, for example, angle.
|
An expression to calculate the values of a variable for the ledge, which conforms to the Exclude from Calculation parameter (v86), shall be as follows:
GOST==20189&&angle==90||GOST==20190?0:1 (see the figure).
|
For convenience of work, spaces and parentheses can be used in the expression: (GOST == 20189) && (angle == 90°) || (GOST == 20190) ? 0 : 1 |