<!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>ug_oper_askLibrefOfLibObject()</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_topic3" id="xps10_pagetitle">ug_oper_askLibrefOfLibObject()</div>
      <hr noshade="true">
      <p class="para_topic">This function returns the library reference of the specified library object.</p>
      <p class="para_topic">The library object is indicated by the input libobject key which is one of the listed below.</p>
      <p class="para_topic">This function only works in the context of an operation. If the specified object is not a library object the return value will be an empty string.</p>
      <p class="para_topic">Libobject keys are: &quot;TOOL_MATERIAL&quot;</p>
      <p class="para_topic">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;PART_MATERIAL&quot;</p>
      <p class="para_topic">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;CUT_METHOD&quot;</p>
      <p class="para_topic">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;MACHINE&quot;</p>
      <p class="para_topic">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TOOL&quot;</p>
      <p class="para_topic">Example: </p><pre class="indent">Defun: ug_cam_get_feeds_speeds_data()
@{ # read feeds &amp; speeds data
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$data &lt;&lt; openfile(getenv(&quot;UGII_CAM_LIBRARY_FEEDS_SPEEDS_ASCII_DIR&quot;)+
&nbsp;
&nbsp;&nbsp;&nbsp;&quot;feeds_speeds.dat&quot;,Read);
&nbsp;
&nbsp;&nbsp;&nbsp;$data_list &lt;&lt; ReadLinesFromFile($data, { });
&nbsp;
&nbsp;&nbsp;&nbsp;CloseFile($data);
&nbsp;
&nbsp;&nbsp;&nbsp;# retrieve librefs 
&nbsp;
&nbsp;&nbsp;&nbsp;$part_mat_libref &lt;&lt; ug_oper_askLibrefOfLibObject(&quot;PART_MATERIAL&quot;);
&nbsp;&nbsp;&nbsp;$tool_mat_libref &lt;&lt; ug_oper_askLibrefOfLibObject(&quot;TOOL_MATERIAL&quot;);
&nbsp;&nbsp;&nbsp;$method_libref &lt;&lt; ug_oper_askLibrefOfLibObject(&quot;CUT_METHOD&quot;);
&nbsp;&nbsp;&nbsp;$tool_dia &lt;&lt; ug_param_askValue(&quot;Tool Diameter&quot;);
&nbsp;&nbsp;&nbsp;# access column 6 or 7 based on part units
&nbsp;&nbsp;&nbsp;$part_unit &lt;&lt; if ug_askPartUnits(&quot;&quot;) = &quot;Pounds_And_Inches&quot; then 6 else 7; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;$retrieve_record &nbsp;&lt;&lt; loop
&nbsp;
&nbsp;&nbsp;&nbsp;{ for $data in $data_list;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for $records is splitString($data,&quot;|&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for $part_mat is nth(4; $records);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for $tool_mat is nth(5; $records);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for $method is nth(3; $records);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for $tool_unit_dia is nth($part_unit; $records);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for $tool_dia_num is @{if ug_numericString?($tool_unit_dia) then &nbsp;&nbsp;&nbsp;&nbsp;MakeNumber($tool_unit_dia)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else 10000;};
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($part_mat_libref = $part_mat) &amp; ($tool_mat_libref = $tool_mat) &amp; &nbsp;&nbsp;&nbsp;&nbsp;($method_libref = $method)&amp; ($tool_dia &lt;= $tool_dia_num) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return {nth(8,$records),nth(9,$records),nth(10,$records),nth(11,$records)};
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return is {0,0,0,0};
&nbsp;&nbsp;&nbsp;};
&nbsp;
&nbsp;&nbsp;&nbsp;$unit_data &lt;&lt; if $part_unit = 6 then &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{nth(1,$retrieve_record),nth(3,$retrieve_record)}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {nth(2,$retrieve_record),nth(4,$retrieve_record)};
&nbsp;
} List;</pre><p class="para_topic">This function opens the feeds &amp; speeds table and retrieves the surface speed &amp; feedrate data according to the PART_MATERIAL, TOOL_MATERIAL, CUT_METHOD and tool diameter.</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 is required when setting the feed rate according to the feeds &amp; speeds table (Ascii version only) and may be used to bypass &quot;Reset from Table&quot;. The feeds &amp; speeds library needs to be updated accordingly and should include the inch or metric tool diameters in the DPT_CUT_IN or DPT_CUT_MM column.</p>
               </div>
            </td>
         </tr>
      </table>
   </body>
</html>