Adding a check to an Expression in Siemens NX

By | 07/22/2016

    If you create and analyze an assemblies in NX then you likely faced a situation, when you need to limit a constraint dimension between some values. By default, Siemens NX doesn’t provide a direct functionality for that, therefore one should find a “workaround” to implement the needed functionality.

lathe_chuck

    One of the possible solutions is to apply a check to an expression, which is associated with a certain Assembly Constraint. It is important to note, that such workaround doesn’t require an extra license: it is included in the base NX.

     We will use the lathe chuck assembly to illustrate the method. This assembly was downloaded from the vendor website (STEP214) and imported into Siemens NX. Then the geometric constraints were assigned. Why do we need to limit some constraints in this assembly? The main idea is that lathe chucks usually have a work range between the jaw’s extreme positions. Therefore it would be useful to limit the appropriate constraint according to it real-world limits.

      We will limit the distance between the rotation axis and the innermost surface of the jaw (pic. 1).

dimension

Pic. 1

   Solution #1: Use the Checkmate functionality

    Create a new expressions to define the maximum and the minimum distance (pic. 2).

expressions

Pic. 2

     Next step: when we created the Distance constraint (wasn’t described in this article) the related expression was also created(pic. 3).

expression_1

Pic. 3

    Now we have to assign a new check to that expression. To do this click MB3 on the expression name and choose Add a Check -> Create New Requirement (pic. 4).

assign_new_check

Pic. 4

    As we need to define an allowed range – choose the Double Sided Comparison under the Definition Method tab. Also define a name and a severity level to Warning. Then pass to the formula and fill it as it shown on the picture 5.

formula

Pic. 5

    Once you press Apply in the Expressions dialog, the check will start to give graphical feedback in the expressions dialog (pic. 6).

applied

Pic. 6

    This requirement and accompanying requirement check can also be examined, edited, etc. in the Requirements Validation HD3D tool (pic. 7).

HD3D Check

Pic. 7

    One more step we have to do is to MB3 on the check ID and select the Specify Objects for Visual Tag option (pic. 8).

Pic. 8

Pic. 8

    Once your dimension value becomes out of defined range, the check will show you an warning message, as it shown at the pic. 9:

Pic. 9

Pic. 9

    On the contrary, if the dimension value lies within the range, HD3D check would show you the positive graphical feedback (pic. 10):

Pic. 10

Pic. 10

   Solution #2: Use the Expressions functionality

    Since NX is a powerful tool for engineering, it always has more than one way to perform a task. Therefore let me offer you the second solution. This time we will use the expression to control the constraint’s value.

    First of all go to Expressions (Ctrl+E) and create a new one. We will use it to drive the geometry and to check whether the dimension value lies withing the possible range (pic 1).

Pic. 1

Pic. 1

    Now create a new expression with the name controlExpression.

if(controlCyl < minDist)(minDist)else(if(controlCyl > maxDist)(maxDist)else(controlCyl))

  We will use the same lathe chuck, but we have to create a secondary geometry. Create a sketch on the top surface of the jaw. Draw a circle with the center on the lathe axis and dimension it with diameter equals to controlExpression (pic. 2).

Pic. 2

Pic. 2

    Finish the Sketch and use Extrude feature with the Body Type set to Sheet to create a cylindrical surface from the circle (pic. 3).

Pic. 3

Pic. 3

    Now it’s neccessary to add an assembly constraint to the jaws: they have to touch our surface (pic. 4).

Pic. 4

Pic. 4

    Finally, if changing the controlCyl value the jaws would be always within the possible range, because of using the controlExpression, which checks whether the value is within the range or not.

Alex Sergeenko

Please note, that all the information on this site are protected by copyrights. It is not allowed to use it without the author’s permission.



Leave a Reply