<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Tips and Techniques</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <div class="title_topic3" id="xps10_pagetitle"> Tips and Techniques</div>
      <hr noshade="true">
      <div class="title_division"> Non-dimensional Expressions</div>
      <p class="para_division"> The program may not know the dimensionality of some expressions. In this case, the program calculates the dimensionality of as many expressions as possible, but will not make any assumptions for those expressions whose dimensionality could not be calculated. Therefore, the original expression variable (the right hand side) may be lost. However, after the conversion, the  <em>value</em> of the expression will be correct.
      </p>
      <div class="title_division"> What is an Expression?</div>
      <p class="para_division"> An expression is a statement defining a relationship. All expressions have a value (a number which may or may not have a fractional part) which is assigned to the left side of the expression. An expression relation is both the left-hand side and right-hand side of an expression equation (i.e., a <em>=b+c).</em></p>
      <div class="title_division"> Dimensionality</div>
      <p class="para_division"> An expression can have any length dimensionality. A dimensionality of 0 represents a scalar quantity (i.e., an angle, a count). A dimensionality of 1 represents a single dimension quantity (i.e., a length). A dimensionality of 2 represents a 2nd degree quantity (i.e., an area).</p>
      <p class="para_division"> You can explicitly assign a dimensionality to an expression by using the  <em>k(), mm() </em>and in() functions provided by NX.
      </p>
      <table bgcolor="#F7F7F7" border="0" cellpadding="2" cellspacing="3" width="100%" align="center">
         <tr bgcolor="#E0E0E0">
            <th colspan="1" rowspan="1" valign="top">
               <p class="para_th"> Expression Relation</p>
            </th>
            <th colspan="1" rowspan="1" valign="top">
               <p class="para_th"> exp1 (values seen as inches)</p>
            </th>
            <th colspan="1" rowspan="1" valign="top">
               <p class="para_th"> exp1 (values seen as mm)</p>
            </th>
            <th colspan="1" rowspan="1" valign="top">
               <p class="para_th"> Dimensionality</p>
            </th>
         </tr>
         <tr>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> exp1=k(5)</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 5</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 5</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 0</p>
            </td>
         </tr>
         <tr>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> exp1=in(5)</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 5</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 127</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 1</p>
            </td>
         </tr>
         <tr>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> exp1=mm(5)</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> .1968503937</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 5</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 1</p>
            </td>
         </tr>
         <tr>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> exp1=in(in(5))</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 5</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 322.8</p>
            </td>
            <td colspan="1" rowspan="1" valign="top">
               <p class="para_td"> 2</p>
            </td>
         </tr>
      </table><br><p class="para_division"> The dimensionality of all system-generated expressions are implicitly defined.</p>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body"> &nbsp;  It is bad practice to imbed system-generated expressions in the  <em>k(), in(),</em> and  <em>mm() </em>functions.
                  </p>
               </div>
            </td>
         </tr>
      </table>
      <div class="title_division"> Calculating Dimensionality</div>
      <p class="para_division"> The program attempts to calculate the dimensionality of user-created expressions which are not explicitly defined with the k(), in(), and  <em>mm()</em> functions. To calculate dimensionality, the program does the following:
      </p>
      <ul>
         <li>
            <p class="para_item"> Assigns a dimensionality to all system-generated and explicitly defined user-created expressions.</p>
         </li>
         <li>
            <p class="para_item"> Insures that the dimensionality of both the left and right-hand sides of an expression relation are balanced to calculate the dimensionality of the user-created expressions.</p>
         </li>
      </ul>
      <p class="para_division"> For example, the expressions:</p>
      <ul class="unmarkedList">
         <li>
            <p class="para_item"> p1=5.0</p>
            <p class="para_item">p2=10.0</p>
            <p class="para_item">var1=p1+p2</p>
            <p class="para_item">var2=var1</p>
         </li>
      </ul>
      <p class="para_division"> where,</p>
      <ul>
         <li>
            <p class="para_item"> p1 and p2 are system-generated expressions.</p>
         </li>
         <li>
            <p class="para_item"> var1 &amp; var2 are user-created expressions.</p>
         </li>
      </ul>
      <p class="para_division"> The program would convert the expressions in the following manner:</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item"> p1 &amp; p2 are assigned a dimensionality of 1.</p>
         </li>
         <li>
            <p class="para_item"> Dimensionality of  <em>var1 </em>is calculated to be equal to 1.
            </p>
         </li>
         <li>
            <p class="para_item"> Dimensionality of var2 is calculated to be equal to 1.</p>
         </li>
      </ol>
      <div class="title_division"> Converting Expression Strings</div>
      <p class="para_division"> The expression string of an expression relation is maintained if the following conditions are met:</p>
      <ul>
         <li>
            <p class="para_item"> The dimensionality of all expressions and numeric values referenced in the expression string are known or calculated.</p>
         </li>
         <li>
            <p class="para_item"> The dimensionality of the expression string must be the same as the dimensionality of its respective expression variable.</p>
         </li>
      </ul>
      <p class="para_division"> If either condition fails, the program replaces the expression string by its corresponding numeric value and displays comment fields appended to the expression string as follows:</p><pre class="indent"> exp var = numeric value // expression string // VALUE ONLY

// dim n // user's original comments</pre><p class="para_division"> where,</p>
      <ul class="unmarkedList">
         <li>
            <p class="para_item">exp var is the expression variable. </p>
         </li>
      </ul>
      <p class="para_division"> The  <em>numeric value</em> is the value of the evaluated expression string (prior to conversion) times the appropriate conversion factor. The appropriate conversion factor is only applied if the dimensionality of the expression variable is known, otherwise, no conversion factor is applied.
      </p>
      <p class="para_division"> The original expression string, can easily be restored by removing the comment field delimiters (//).</p>
      <p class="para_division">  <em>VALUE ONLY</em>is a string to flag that the expression string was not converted.
      </p>
      <p class="para_division"> The dimensionality of exp var is  <em>dim</em> n. The  <em>n</em> value can either be a &quot;?&quot; or any integer value.
      </p>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body"> &nbsp;  A &quot;?&quot; denotes the case where the dimensionality of the expression variable is unknown and thus, no conversion factor is applied to the numeric value.</p>
               </div>
            </td>
         </tr>
      </table>
      <div class="title_division"> Expressions with Ambiguous Dimensionality</div>
      <p class="para_division"> An expression is ambiguous if an expression's calculated dimensionality varies from one expression relation to another. The program replaces all expression strings referencing an ambiguous expression variable by their corresponding numeric value.</p>
      <p class="para_division"> For example, the expression:</p>
      <ul class="unmarkedList">
         <li>
            <p class="para_item">var1=45 </p>
            <p class="para_item">p0=var1</p>
            <p class="para_item">p1=var1</p>
         </li>
      </ul>
      <p class="para_division"> where,</p>
      <ul>
         <li>
            <p class="para_item"> p0 is a system-generated expression representing a taper angle (0 dimensionality).</p>
         </li>
         <li>
            <p class="para_item"> p1 is a system-generated expression representing the diameter of a cylinder (dimensionality of 1).</p>
         </li>
         <li>
            <p class="para_item"> var1 is a user-created expression.</p>
         </li>
      </ul>
      <p class="para_division"> The program converts the expressions in the following manner:</p>
      <ul class="unmarkedList">
         <li>
            <p class="para_item">  var1=45 // dim ?</p>
            <p class="para_item">p0=45 // var1 // VALUE ONLY // dim 0</p>
            <p class="para_item">p1=115.30 // var1 // VALUE ONLY // dim 1  </p>
         </li>
      </ul>
   </body>
</html>