<!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>TCL based design rules</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">TCL based design rules</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/write_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/write_process.html');return(false);">How To</a></p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td">Options</p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('routingadmin/write_example.html');return(false);">Related Topics</a></p>
            </td>
         </tr>
      </table><br><p class="para_topic">For each Routing application, basic design rules are provided that use a TCL ( a common scripting language) interface. The TCL interface is available to allow each site to modify the basic rules to meet specific requirements without having to write and compile NX Open routines. It is not possible to create new rules using the TCL interface, only to modify the existing basic rules.</p>
      <p class="para_topic">For example, there exists a file named route_mech_connections.tcl, located in the rules folder of the ugrout_mech folder in a standard installation. The file contains one rule that checks for connection compatibility using four characterstics: DIAMETER, NPS, GENDER and CONNECTION_TYPE. Whenever you create a connection, meaning that two Routing ports are coincident and have opposite alignment vectors, the design rule verifies that the NPS or DIAMETER characteristics for each of the ports have equal values, that the GENDER characteristics do not have equal values, and that the CONNECTION_TYPE characteristics are equal. If you are using different characteristic titles, you may edit the TCL file to use different characteristic names.</p>
      <p class="para_topic">The rule can be further modified to add a fourth criteria. You may ask for any characteristic, such as MATERIAL. The same check could be made to assure the values of the MATERIAL characteristic of each port is equal. You can make any such checks by modifying the TCL files provided, but only simple characteristic value checking may be performed. Any more advanced checking requires writing a NX Open program.</p>
      <div class="title_division">NX Open based design rules</div>
      <p class="para_division">You can create design rules that perform very simple or extremely complex checks of the model through NX Open programming.&nbsp;The following topics explain how to create custom design rules.</p>
      <div class="title_division">Assumptions</div>
      <p class="para_division">The design rule code is responsible for creating, modifying and deleting violations during processing. There is no other way for violations to be created or deleted. Interactively, you can create overrides and delete them while browsing violations. Overrides are automatically removed when the violation is deleted.</p>
      <div class="title_division">Modules</div>
      <p class="para_division">The UF_RULE functions, found in the NX Open Help, are used to manipulate Design Rule related objects and data. There are also UF_ROUTE functions that you can use specifically for design rules and violations for Routing. You can use other UF_ROUTE functions to gather information from routing objects, such as characteristics, or stock lengths, in order to determine if a violation exists.</p>
      <div class="title_division">Design rule function</div>
      <p class="para_division">The general prototype of a Routing design rule function is:</p>
      <table bgcolor="#F0F0F0" cellpadding="2" cellspacing="4" width="95%" align="center">
         <colgroup span="1">
            <col span="1" width="75*">
            <col span="1" width="124*">
         </colgroup>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
               <p class="para_td">extern void function_name</p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
               <p class="para_td">(tag_t rule, UF_ROUTE_design_rule_data_p_t data)</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" height="34" rowspan="1" valign="top">
               <p class="para_td">function_name</p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" height="34" rowspan="1" valign="top">
               <p class="para_td">The name by which you want the design rule function to be called.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
               <p class="para_td">rule</p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
               <p class="para_td">Tag of the rule being checked. Routing automatically creates rule objects for every rule in the design rules file. Use UF_RULE functions to access rule data.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
               <p class="para_td">data</p>
            </td>
            <td bgcolor="#f7f7f7" colspan="1" rowspan="1" valign="top">
               <p class="para_td">Pointer to data to be processed by the design rule. See  <a class="links" href="javascript:void(0)" onclick="top.openFile('routingadmin/write_data.html');return(false);">The Data</a> for details.
               </p>
            </td>
         </tr>
      </table><br></body>
</html>