<!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>Setting Up The Tool Query</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_topic4" id="xps10_pagetitle">Setting Up The Tool Query</div>
      <hr noshade="true">
      <p class="para_topic">At this point you have created three operations: spot drill, drill and counterbore. Now you need to choose the tool for each operation.</p>
      <p class="para_topic">The example below shows the rules for selecting the tool.</p>
      <ul>
         <li>
            <p class="para_item">For the spot drill operation &quot;The tool has to be a spot drill and the diameter of the tool should be greater than or equal to the counterbore diameter and the point angle has to be 90 degrees.&quot;</p>
         </li>
         <li>
            <p class="para_item">For the drill operation &quot;The tool has to be a twist drill and the diameter of the tool must be equal to the diameter of the hole.&quot;</p>
         </li>
         <li>
            <p class="para_item">For the counterbore operation &quot;The tool has to be a counterbore tool and the diameter of the tool must be equal to the diameter of the counterbore.&quot;</p>
         </li>
      </ul>
      <p class="para_topic">To write these rules you must know the tool query syntax and what type of tool to use for each operation. When referring to the above example, these rules are constructed based on the parameters of the tools and the parameters of the counterbore features.</p>
      <ul>
         <li>
            <p class="para_item">Change the Operation Navigator to the Geometry View and edit the CB_HOLE geometry group. The available parameters of the feature are given below:</p>
            <ul>
               <li>
                  <p class="para_item">HOLE DIAMETER</p>
               </li>
               <li>
                  <p class="para_item">C-BORE DIAMETER</p>
               </li>
               <li>
                  <p class="para_item">HOLE DEPTH</p>
               </li>
               <li>
                  <p class="para_item">C-BORE DEPTH</p>
               </li>
               <li>
                  <p class="para_item">TIP ANGLE</p>
               </li>
            </ul>
         </li>
      </ul>
      <p class="para_topic">Use this information when constructing the tool queries, then change the Operation Navigator back to the Method View.</p>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/tip.gif" alt="Tip" title="Tip"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_tip">
                  <p class="para_tip_body">You can optionally ignore the tool query in an operation to manually select tools.</p>
               </div>
            </td>
         </tr>
      </table>
      <div class="title_division">Edit the SPOT_DRILL_METHOD Group</div>
      <p class="para_division">In the DRILL_METHOD dialog, in the section named Tool Query there are two buttons: Class and Query.</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Select the Class button. </p>
            <p class="para_item">In the Library Class Selection dialog select Tool&rarr;Drilling&rarr;Spot Drill. Click OK to exit the dialog. This has now specified that when the system looks for tools in a library it looks among spot drills only.</p>
         </li>
         <li>
            <p class="para_item">Select the Query button. </p>
            <p class="para_item">In the Query from Method dialog, if the Variable Type is set to Database Attributes the following options are available:</p>
            <ul>
               <li>
                  <p class="para_item">Diameter</p>
               </li>
               <li>
                  <p class="para_item">Holder</p>
               </li>
               <li>
                  <p class="para_item">Material</p>
               </li>
               <li>
                  <p class="para_item">PointAngle</p>
               </li>
               <li>
                  <p class="para_item">libref</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Select Diameter. In the Query section build your query. The syntax for the query is as follows:</p>
            <ul>
               <li>
                  <p class="para_item">When referring to Database Attributes they have to be enclosed in DB( ).</p>
               </li>
               <li>
                  <p class="para_item">When referring to any Knowledge Fusion rules, the rules have to be enclosed in &amp;KFR( ).</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Make sure your query says:</p>
            <p class="para_item">DB(Diameter) &lt;= &amp;KFR(ug_oper_askFeatureAttributeValue(&quot;C-Bore Diameter&quot;, Number)) &amp;&amp; DB(PointAngle)==90 </p>
            <p class="para_item">This is saying that the c-bore diameter parameter is being accessed through a Knowledge Fusion rule. Also the Knowledge Fusion rule is using a utility function ug_oper_askFeatureAttributeValue to access the c-bore diameter parameter.</p>
         </li>
         <li>
            <p class="para_item">Click the Check Query Syntax button to make sure there are no syntax errors. </p>
         </li>
         <li>
            <p class="para_item">If there is no error query is complete. Click OK to exit the dialog.</p>
         </li>
         <li>
            <p class="para_item">Verify whether or not the tool query is successful with the following steps:</p>
            <ul>
               <li>
                  <p class="para_item">In the Operation Navigator double click the operation. </p>
               </li>
               <li>
                  <p class="para_item">In the Hole_Making dialog, click the Groups tab.</p>
               </li>
               <li>
                  <p class="para_item">Select the Tool radio button and click the Select button. &nbsp;</p>
               </li>
               <li>
                  <p class="para_item">If an error displays, check your syntax for errors. &nbsp;</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Save the part file.</p>
         </li>
      </ol>
      <div class="title_division">Edit the DRILL_METHOD Group</div>
      <p class="para_division">In the DRILL_METHOD dialog, in the section named Tool Query there are two buttons: Class and Query.</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Select the Class button.</p>
            <p class="para_item">In the Library Class Selection dialog select Tool&rarr;Drilling&rarr;Twist Drill. Click OK to exit the dialog. This has now specified that when the system looks for tools in a library it looks among twist drills only.</p>
         </li>
         <li>
            <p class="para_item">Select the Query button. </p>
            <p class="para_item">In the Query from Method dialog, if the Variable Type is set to Database Attributes the following options are available:</p>
            <ul>
               <li>
                  <p class="para_item">Diameter</p>
               </li>
               <li>
                  <p class="para_item">FluteLength</p>
               </li>
               <li>
                  <p class="para_item">Holder</p>
               </li>
               <li>
                  <p class="para_item">Material</p>
               </li>
               <li>
                  <p class="para_item">PointAngle</p>
               </li>
               <li>
                  <p class="para_item">libref</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Select Diameter. In the Query section you build your query. </p>
            <p class="para_item">Make sure your query says:</p>
            <p class="para_item">DB(Diameter) == &amp;KFR(ug_oper_askFeatureAttributeValue(&quot;Hole Diameter&quot;, Number))</p>
            <p class="para_item">This is saying that the hole diameter parameter is being accessed through a Knowledge Fusion rule. Also the Knowledge Fusion rule is using a utility function ug_oper_askFeatureAttributeValue to access the hole diameter parameter.</p>
         </li>
         <li>
            <p class="para_item">Click the Check Query Syntax button to make sure there are no syntax errors. </p>
         </li>
         <li>
            <p class="para_item">If there is no error the query is complete. Click OK to exit the dialog.</p>
         </li>
         <li>
            <p class="para_item">Verify whether or not the tool query is successful.</p>
            <ul>
               <li>
                  <p class="para_item">In the Operation Navigator double click the operation. </p>
               </li>
               <li>
                  <p class="para_item">In the Hole_Making dialog, click the Groups tab.</p>
               </li>
               <li>
                  <p class="para_item">Select the Tool radio button and click the Select button. &nbsp;</p>
               </li>
               <li>
                  <p class="para_item">If an error displays, check your syntax for errors. &nbsp;</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Save the part file. </p>
         </li>
      </ol>
      <div class="title_division">Edit the CB_METHOD Group</div>
      <p class="para_division">In the DRILL_METHOD dialog, in the section named Tool Query there are two buttons: Class and Query.</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Select the Class button. </p>
            <p class="para_item">In the Library Class Selection dialog select Tool&rarr;Drilling&rarr;Counterbore. Click OK to exit the dialog. This specifies that when the system is looking for tools in a Library it looks among counterbores only.</p>
         </li>
         <li>
            <p class="para_item">Select the Query button. </p>
            <p class="para_item">In the Query from Method dialog, if the Variable Type is set to Database Attributes the following options are available:</p>
            <ul>
               <li>
                  <p class="para_item">CutDia</p>
               </li>
               <li>
                  <p class="para_item">Holder</p>
               </li>
               <li>
                  <p class="para_item">Material</p>
               </li>
               <li>
                  <p class="para_item">PilotDia</p>
               </li>
               <li>
                  <p class="para_item">libref</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Select CutDia. </p>
            <p class="para_item">Make sure your query says:</p>
            <p class="para_item">DB(Diam_1) == &amp;KFR( ug_oper_askFeatureAttributeValue(&quot;C-Bore Diameter&quot;, Number) )</p>
            <p class="para_item">This is saying that the c-bore diameter parameter is being accessed through a Knowledge Fusion rule. Also the Knowledge Fusion rule is using a utility function ug_oper_askFeatureAttributeValue to access the c-bore diameter parameter.</p>
         </li>
         <li>
            <p class="para_item">Click the Check Query Syntax button to make sure there are no syntax errors. </p>
         </li>
         <li>
            <p class="para_item">If there is no error the query is complete. Click OK to exit the dialog.</p>
         </li>
         <li>
            <p class="para_item">Verify whether or not the tool query is successful.</p>
            <ul>
               <li>
                  <p class="para_item">Double click the operation. </p>
               </li>
               <li>
                  <p class="para_item">In the Hole_Making dialog, click the Groups tab.</p>
               </li>
               <li>
                  <p class="para_item">Select the Tool radio button and click the Select button. &nbsp;</p>
               </li>
               <li>
                  <p class="para_item">If an error displays, check your syntax for errors. &nbsp;</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">Save the part file. </p>
         </li>
      </ol>
   </body>
</html>