<!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>Plug-ins</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">Plug-ins</div>
      <hr noshade="true">
      <table cellspacing="4" align="center">
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('routingadmin/app_overview.html');return(false);">Overview</a></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('routingadmin/app_part.html');return(false);">Options</a></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('routingadmin/app_variable.html');return(false);">Related Topics</a></p>
            </td>
         </tr>
      </table><br><p class="para_topic">There are four user exits that are used with <b class="uiTerm">Stock as Components</b>;
      </p>
      <table bgcolor="#F0F0F0" cellpadding="2" cellspacing="4" width="95%" align="center">
         <colgroup span="1">
            <col span="1" width="79*">
            <col span="1" width="120*">
         </colgroup>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><code>TEMP_STOCK_COMPONENT_NAME</code></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td">Generates stock component temporary part name.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><code>STOCK_COMPONENT_NAME</code></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td">Generates stock component part name.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><code>STOCK_COMPONENT_LOOKUP</code></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td">Returns equivalent stock component part.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><code>STOCK_COMPONENT_LOCKED</code></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td">Returns whether or not a stock component can be modified.</p>
            </td>
         </tr>
      </table><br><p class="para_topic">These four user exits are defined as Routing <b class="uiTerm">Plug-ins</b>. There are default plug-ins provided however it is recommended that each customer define their own plug-ins. We provide an example version of the internal default plug-ins to help customers define their specific plug-ins. These plug&ndash;ins are declared in each of the application view files:
      </p>
      <p class="para_topic">PLUGINS</p>
      <p class="para_topic">!Name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Library/type &nbsp;&nbsp;&nbsp;&nbsp;Function/Entry Point</p>
      <p class="para_topic">!TEMP_STOCK_COMPONENT_NAME is the plug-in that's used for designating the name</p>
      <p class="para_topic">!of a stock component when it is created.</p>
      <p class="para_topic">TEMP_STOCK_COMPONENT_NAME &nbsp;&nbsp;INTERNAL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETURN_TEMP_STOCK_COMPONENT_NAME</p>
      <p class="para_topic">!STOCK_COMPONENT_NAME is the plug-in that's used for designating the name</p>
      <p class="para_topic">!of a stock component when it is renamed, and made permanent.</p>
      <p class="para_topic">!See the <b class="uiTerm">Rename Stock</b> in <a class="links" href="javascript:void(0)" onclick="top.popUpPage('routingtools/index.html?goto=routingtools/title_page.html&vars=-aux,-home','linkInter','menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,location=no,directories=no');return(false);">Routing Tools Help</a> for more information.
      </p>
      <p class="para_topic">STOCK_COMPONENT_NAME &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTERNAL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETURN_STOCK_COMPONENT_NAME</p>
      <p class="para_topic">!STOCK_COMPONENT_LOOKUP is the plug-in that's used for finding an existing stock</p>
      <p class="para_topic">!component that can replace the given component.</p>
      <p class="para_topic">STOCK_COMPONENT_LOOKUP &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTERNAL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETURN_EXISTING_STOCK_COMPONENT</p>
      <p class="para_topic">!STOCK_COMPONENT_LOCKED is the plug-in that's used for determining if a stock</p>
      <p class="para_topic">!component can be modified.</p>
      <p class="para_topic">STOCK_COMPONENT_LOCKED &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTERNAL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETURN_STOCK_COMPONENT_MODIFIABLE</p>
      <p class="para_topic">END_OF_PLUGINS</p>
      <p class="para_topic">The TEMP_STOCK_COMPONENT_NAME and STOCK_COMPONENT_NAME plug&ndash;ins are passed the same structure. The TEMP_STOCK_COMPONENT_NAME is called when a stock component is first created. The data returned from the user exit determines where this temporary stock component is to be stored on save. The default user exit will place components in the folder (or directory in native mode) specified in the Stock Folder preference documented above. The name returned from the default user exit is a unique name that will not conflict with existing parts.</p>
      <p class="para_topic">This unique name is based on the machine that the part is created on, the time that the part was created at, and the process id of NX. The filename of the part consists of the unique name as well as a prefix that indicates the type of the stock component. A prefix of rts indicates a Routing stock part, rto indicates a Routing overstock part, and a prefix of rtw indicates a Routing wire part. The STOCK_NUMBER of the stock is inserted into the name, so that the type of the stock can be easily identified.</p>
      <p class="para_topic">For example:</p>
      <p class="para_topic">rts&ndash;PIPE_1&ndash;STLSUN18&ndash;28VGKJROD101VVHV001.prt </p>
      <p class="para_topic">rto&ndash;INSULATION_2&ndash;STLSUN18&ndash;28VGKJRQKR01VVHXKO1.prt </p>
      <p class="para_topic">rtw&ndash;18_GAUGE&ndash;STLSUN18&ndash;28VGKJRRK1901VVHYSO1.prt </p>
      <p class="para_topic">For Teamcenter, the name is not as unique, as Teamcenter has a limit on the number of characters that can be uses. The unique name will have a prefix of rts, rto, and rtw, and a then a separator &ndash;. A number will be generated based of the current process id of NX, the time, and an internal counter. This number is appended the part name. If this part exists inTeamcenter, then the algorithm is run again to attempt to find a name that isn't used in Teamcenter.</p>
      <p class="para_topic">For example: </p>
      <p class="para_topic">rts&ndash;28VGKJROD101VVHV001.prt </p>
      <p class="para_topic">rto&ndash;28VGKJRQKR01VVHXKO1.prt </p>
      <p class="para_topic">rtw&ndash;28VGKJRRK1901VVHYSO1.prt </p>
      <p class="para_topic">The <code>STOCK_COMPONENT_NAME</code> user exit is called from the <b class="uiTerm">Rename Stock</b> function. The default user exit launches the file selection dialog box in interactive mode, and will return nothing in batch mode. This means that the default user exit will not change the name of a stock component in batch mode, each customer must come up with a user exit that will automatically rename components during batch mode.
      </p>
      <p class="para_topic">The default <code>STOCK_COMPONENT_LOOKUP</code> user exit looks only at components already used in the work part to see if there is a valid component to reuse.
      </p>
      <p class="para_topic">The default <code>STOCK_COMPONENT_LOCKED</code> user exit checks to see if the part is write&ndash;able in native mode, and calls the locked part functionality in Teamcenter Integration mode.
      </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">This functionality does not apply to <b class="uiTerm">Legacy Stock</b>.
                  </p>
               </div>
            </td>
         </tr>
      </table>
   </body>
</html>
