<!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>Converting a Pre-NX 4 Tool Library</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_topic2" id="xps10_pagetitle">Converting a Pre-NX 4 Tool Library</div>
      <hr noshade="true">
      <p class="para_topic">The format of the ASCII tool libraries has changed in NX 4. If you made any changes to the tool libraries that are installed with NX in a native environment in a previous release, then you must do a one-time conversion of your prior tool databases to the new format. You must perform the conversion for both the English and metric <b class="literalText">tool_database.dat</b> files. These are located in the folders identified by the variables  <b class="literalText">UGII_CAM_LIBRARY_TOOL_ENGLISH_DIR</b> and <b class="literalText">UGII_CAM_LIBRARY_TOOL_METRIC_DIR</b>.  
      </p>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/caution.gif" alt="Caution" title="Caution"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_caution">
                  <p class="para_caution_body">Before doing the conversion, make backup copies of both of these files.</p>
               </div>
            </td>
         </tr>
      </table>
      <p class="para_topic">After the conversion program is complete, the software places the converted library in the same directory as the input library under the name <i class="variableText">&lt;input_file_name&gt;</i><b class="literalText">_converted.dat</b>, where <i class="variableText">&lt;input_file_name&gt;</i> is the name of your original customized tool library. 
      </p>
      <p class="para_topic">The conversion program does the following:</p>
      <ul>
         <li>
            <p class="para_item">Passes all comments (records which are not <b class="literalText">FORMAT</b> or <b class="literalText">DATA</b> records) through to the converted database file.
            </p>
         </li>
         <li>
            <p class="para_item">Outputs all <b class="literalText">FORMAT</b> records to the converted database file. Those <b class="literalText">FORMAT</b>s which specify tool holder fields have these fields removed from their format and a <b class="literalText">libref</b> field added to the end of the format specification.
            </p>
         </li>
         <li>
            <p class="para_item">Skips any tool in the library to be converted that matches a tool in the standard NX Library.</p>
            <table border="0">
               <tr>
                  <td valign="top" align="left"><img align="left" src="../graphics/caution.gif" alt="Caution" title="Caution"></td>
                  <td valign="bottom" align="left" width="100%">
                     <div class="para_caution">
                        <p class="para_caution_body">If you modified the records of the default tools and want to keep the changes, you must assign each of the modified tools a unique <b class="literalText">libref</b> <em>before</em> doing the conversion. If you do not, your changes will be lost because the default tools in the new NX 4 library overwrite the modified default tools in your old library. 
                        </p>
                     </div>
                  </td>
               </tr>
            </table>
         </li>
         <li>
            <p class="para_item">Outputs any non-matched tool that does not have a holder definition to the converted database file as is.</p>
         </li>
         <li>
            <p class="para_item">For any tool that has a tool holder defined, the conversion program converts the holder to a parametric holder and merges it into the NX 4 holder library unless it already matches an existing holder. The software outputs the appropriate tool holder <b class="literalText">libref</b> with the converted tool record.
            </p>
         </li>
      </ul>
      <p class="para_topic">If you have not changed any of the classes but only added additional tools to the existing library, do the following: </p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Within the <b class="uiTerm">Manufacturing</b> application, select <b class="uiTerm">Tools</b> &rarr; <b class="uiTerm">Convert Tool Library</b>.
            </p>
         </li>
         <li>
            <p class="para_item">Select the library to be converted. For example, to browse for the English file you might go to &hellip;<i class="fileName">NX 3.0\MACH\resource\library\tool\english\tool_database.dat</i>. When the system finishes converting the library, it stores records for the added tools in the <i class="variableText">&lt;input_file_name&gt;</i><b class="literalText">_converted.dat</b> file.
            </p>
         </li>
         <li>
            <p class="para_item"> Open the converted file in a text editor and copy the records to the correct location in the NX 4 version of <i class="fileName">tool_database.dat</i>. Do this by matching up the <i class="variableText">&lt;input_file_name&gt;</i><b class="literalText">_converted.dat</b> T and ST of your converted tools with the same section in the NX 4 library file.
            </p>
            <table border="0">
               <tr>
                  <td valign="top" align="left"><img align="left" src="../graphics/caution.gif" alt="Caution" title="Caution"></td>
                  <td valign="bottom" align="left" width="100%">
                     <div class="para_caution">
                        <p class="para_caution_body">You must convert the English and metric libraries separately. You cannot mix units in the same file. Ensure that the units of the source and target libraries are the same. </p>
                     </div>
                  </td>
               </tr>
            </table>
         </li>
         <li>
            <p class="para_item">Repeat the above steps for each library that you need to convert. </p>
         </li>
      </ol>
      <p class="para_topic">If you have added library classes or fields to released library classes, you must also perform the following tasks for each library that you need to convert:</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Open the converted file in a text editor and migrate the converted data to the release tool library as follows:</p>
            <ul>
               <li>
                  <p class="para_item">For tools that belong to classes existing in the release library and for which the <b class="literalText">FORMAT</b>s have not been modified, cut the <b class="literalText">DATA</b> records from the converted library and paste them into the release library.
                  </p>
               </li>
               <li>
                  <p class="para_item"> For tools that belong to classes existing in the release library and to which you have added new fields, cut the converted <b class="literalText">FORMAT</b> and <b class="literalText">DATA</b> records from the converted library and paste them into the release library. Delete the original <b class="literalText">FORMAT</b> records. Either add the new fields to existing <b class="literalText">DATA</b> records in the release library or delete the <b class="literalText">DATA</b> records.
                  </p>
               </li>
               <li>
                  <p class="para_item"> For tools that belong to new classes not in the release library, cut the <b class="literalText">FORMAT</b> and <b class="literalText">DATA</b> records from the converted library and paste them into the release library, along with any documentary comments contained in the converted library.  Add <b class="literalText">#CLASS</b> and <b class="literalText">#END_DATA</b> records to the appropriate positions in the release library for each new class.  The <b class="literalText">#CLASS</b> record should contain the class name for this class as defined in the <i class="fileName">dbc_tool_ascii.def</i> file.
                  </p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item"> If any new classes are added to the tool library, modify <i class="fileName">dbc_tool_general.tcl</i> in the <b class="literalText">UGII_UG_LIBRARY_DIR</b> as follows:
            </p>
            <ul>
               <li>
                  <p class="para_item">Add new library types and subtypes for the new library classes to the global section.</p>
               </li>
               <li>
                  <p class="para_item"> Add the mapping of the new library classes to the desired NX type and subtype in <b class="literalText">UGLIB_convert_type_and_subtype</b>.
                  </p>
               </li>
               <li>
                  <p class="para_item">Add the new library classes to the appropriate spot in <b class="literalText">UGLIB_map_class</b> to support tool export.
                  </p>
               </li>
               <li>
                  <p class="para_item">Add the new classes to <b class="literalText">UGLIB_ask_class</b>. 
                  </p>
               </li>
               <li>
                  <p class="para_item">Add the mapping of the new classes to the library type and subtype in <b class="literalText">UGLIB_ask_class_type_and_subtype</b>. 
                  </p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">	Add the new field and class definitions to <i class="fileName">dbc_tool_ascii.def</i> in <b class="literalText">UGII_CAM_LIBRARY_TOOL_ASCII_DIR</b>. 
            </p>
         </li>
         <li>
            <p class="para_item"> Modify <b class="literalText">DBC_retrieve</b> in <i class="fileName">dbc_tool_ascii.tcl</i> in <b class="literalText">UGII_CAM_LIBRARY_TOOL_ASCII_DIR</b> to support the new fields and/or classes.
            </p>
         </li>
         <li>
            <p class="para_item"> Modify <i class="fileName">dbc_tool_ascii_export.tcl</i> in <b class="literalText">UGII_CAM_LIBRARY_TOOL_ASCII_DIR</b> as follows: 
            </p>
            <ul>
               <li>
                  <p class="para_item">Add any fields not stored with the tool in NX to <b class="literalText">ASC_ask_missing_aliases</b> to allow the user to supply values for these fields when exporting tools to the library.
                  </p>
               </li>
               <li>
                  <p class="para_item">Add a block for new tool classes to <b class="literalText">ASC_build_tool_record</b> to call the appropriate procedure to construct a <b class="literalText">DATA</b> record during tool export.
                  </p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item"> Modify <i class="fileName">dbc_tool_build_ascii.tcl</i> in <b class="literalText">UGII_CAM_LIBRARY_TOOL_ASCII_DIR</b> as follows:
            </p>
            <ul>
               <li>
                  <p class="para_item">For each new tool class, add a procedure to construct the DATA record for that class.  This is the procedure called from <b class="literalText">ASC_build_tool_record</b> described in the previous point.
                  </p>
               </li>
               <li>
                  <p class="para_item">For existing NX classes to which you have added fields, modify the appropriate build routine procedure to output the field values in the correct position.</p>
               </li>
            </ul>
         </li>
      </ol>
   </body>
</html>