<!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>Header, Body, Footer</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_topic7" id="xps10_pagetitle"> Header, Body, Footer</div>
      <hr noshade="true">
      <p class="para_topic">The presentation format for the object class information can be described in terms of Header, Body, and Footer. When the classes of objects in different hierarchy are interrogated recursively, the presentation of the data can be illustrated as follows:</p>
      <p class="para_topic">MOM_cycle_objects command uses six keywords to accomplish this task of presenting the data:</p>
      <ul>
         <li>
            <p class="para_item">HDRT HDRF (header)</p>
         </li>
         <li>
            <p class="para_item">BDYT BDYF (body)</p>
         </li>
         <li>
            <p class="para_item">FTRT FTRF (footer)</p>
         </li>
      </ul>
      <p class="para_topic">Here are some examples of how headers, bodies and footers are used. Note that we do not have SETUP body processors because a part has exactly one SETUP. Body processors are called for each object of the specified object type. If there is only one object of this type, you can either put the processor in the Header or Footer.</p>
      <p class="para_topic">&nbsp;[MOM_cycle_objects</p><pre class="indent">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{SETUP HDRT='Setup for Part $mom_part_name' FTRT='End of Documentation for $mom_date'
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{OPER HDRT='These Operations are contained in this Setup' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;BDYT='Operation: $mom_oper_name' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;FTRT='End of Operations'
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;]
&nbsp;</pre><p class="para_topic">In this case when MOM_cycle_objects executes, the following is executed automatically:</p>
      <ul>
         <li>
            <p class="para_item">The variable $mom_part_name is translated, inserted into the HDRT for SETUP and then the HDRT for SETUP is printed.</p>
         </li>
         <li>
            <p class="para_item">The OPER's HDRT is printed.</p>
         </li>
         <li>
            <p class="para_item">For each operation in the Setup do</p>
         </li>
         <li>
            <p class="para_item">If the Tcl script contains a procedure named MOM_OPER_BODY then execute it.</p>
         </li>
         <li>
            <p class="para_item">Translate $mom_oper_name, insert into the OPER's BDYT and then print the OPER's BDYT.</p>
         </li>
         <li>
            <p class="para_item">Print the OPER's FTRT.</p>
         </li>
         <li>
            <p class="para_item">Translate $mom_date, insert into SETUP's FTRT and print the SETUP's FTRT.</p>
         </li>
      </ul>
      <p class="para_topic">Note that for Body processing the Tcl procedure, if it exists, is executed first followed by the BDYT or BDYF. Of course, you do not need a BDYF or BDYT. If you do not have an object type Body procedure or a BDYT or BDYF for that object then there is no output generated for that object type. This could be useful if you want all the TOOLs in a SETUP in the order in which they are used but did not want to see the operations in which they are used. If this were the case you could use something like the following and have an empty MOM_OPER_BODY Tcl procedure.</p><pre class="indent">[MOM_cycle_objects
{SETUP 
&nbsp;&nbsp;{OPER 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{TOOL 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HDRT='Tool Heading'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BDYT='Tool Name: $mom_tool_name'
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp; &nbsp;}
&nbsp;}
]</pre><p class="para_topic">&nbsp;For an example of using MEMBERS consider the following:</p><pre class="indent">&nbsp;[MOM_cycle_objects
&nbsp; {SETUP
&nbsp;&nbsp;&nbsp;&nbsp;HDRT='CAM Part Dump for $mom_part_name
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{MEMBERS
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HDRT='This part contains the following:'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BDYT='Object: $obj_type, $obj_type_name, $obj_name'
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp; &nbsp;}
]</pre><p class="para_topic">In this case when MOM_cycle_objects is executed the following is executed automatically:</p>
      <ul>
         <li>
            <p class="para_item">Translate mom_part_name, insert into SETUP's HDRT and print the HDRT.</p>
         </li>
         <li>
            <p class="para_item">For the SETUP object:</p>
            <ol type="1" start="1">
               <li>
                  <p class="para_item">Print the MEMBERS HDRT.</p>
               </li>
               <li>
                  <p class="para_item">Get all the corresponding BODY that belongs to the MEMBER and for each of these objects:</p>
               </li>
            </ol>
            <ul>
               <li>
                  <p class="para_item">Perform the Tcl procedure for the object type of this object.</p>
               </li>
               <li>
                  <p class="para_item">Translate the variables obj_type, obj_type_name and obj_name, insert them into the MEMBERS BDYT and print the MEMBERS BDYT.</p>
               </li>
               <li>
                  <p class="para_item">Let OBJECT be the current object and repeat all the steps within step 2.</p>
               </li>
            </ul>
            <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">Note that in step 2, if the current object is of type OPER then the Tcl procedure MOM_OPER_BODY is executed. If it is of type TOOL then MOM_TOOL_BODY is executed. These procedures exist in the Tcl script whose name is supplied in the CAM configuration file.</p>
                     </div>
                  </td>
               </tr>
            </table>
            <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">Since the Tcl procedure is executed first, you can define variables in the Tcl procedure and then use them in the BDYT text. </p>
                     </div>
                  </td>
               </tr>
            </table>
         </li>
      </ul>
   </body>
</html>