For the punch process, a Creo Elements/Direct Sheet Metal shop definition file contains:
• a "Punch Types" table specifying punch tool types (such as "Keyway In").
• a set of tool tables. Each of these tables specifies the dimensions and other process parameters of the individual tools of a given punch tool type. For instance, the "Keyway In" table includes a separate row for each keyway in tool. If a given punch tool type is represented by a single punch tool, the associated tool table contains only a single parameter record (a single row of table values).
Creo Elements/Direct Sheet Metal punch tools perform a Creo Elements/Direct Modeling Mill operation on the parts to which they are applied.
Parametric Punch Tools
As of CoCreate Sheet Metal revision 4.5, all punch tool types specified in the sha_demoshop.lsp sample shop definition file are "parametric tools". This means that the user will select the appropriate tool dimension from a selection list at runtime. In the TDB, you (or your TDB administrator) can specify additional tool sizes by adding a row (an additional parameter record) to the associated tool table.
Adding a Parametric Punch Tool of an Existing Type
To add a parametric punch tool of an existing type, you need to add the new punch tool specification (an additional row) to the associated punch tool table. Either use the Technology Database Browser (see
Adding a Punch Tool) or edit the underlying TDB table manually.
For example, if you want to add a punch tool of type "rnd", proceed as follows:
1. Open the shop definition file (for instance, your working copy of the sha_demoshop.lsp file).
2. Display the "Round" table in your shop definition file. This table is shown below.
3. Under :CONTENTS, add the line which specifies your additional punch tool. For the "demoshop", each "round" punch tool specification consists of entries for the following columns:
:DIA
The tool diameter.
:TOOL_ID
The tool identification number.
:DESCR
A descriptive tool name.
:MIN_THICK
The minimum material thickness the tool is designed for.
:MAX_THICK
The maximum material thickness the tool is designed for.
:PREFERENCE
Preference status: ":PREF" for preferred tools or ":NONPREF" for non-preferred tools.
:ADVICE
Creo Elements/Direct Sheet Metal fills this column according to checks against :MAX_THICK, and/or :MIN_THICK (if these entries exist).
:FLAT-TEXT
Same as in "The General Structure of Tables".
The following parameter record (tool table row) is an example of an additional round punch tool specification.
(6.00 "01042" "EM" 0 1.5 ":NONPREF" "-")
The hole diameter produced by this new punch tool is 6.00 mm. Its ID number is 01042. Its name is EM. It is a non-preferred tool designed for any thickness of up to 1.5 mm. The "-" entry is the default entry for the :ADVICE column. At runtime, the "-" entry for the :ADVICE column is dynamically replaced by the tool check result when this tool is listed in the tool selection table.
Parametric Punch Tool Types
Each parametric punch tool type is defined through a special C++ or LISP based function. This function defines a sequence of Creo Elements/Direct Modeling 2D commands creating the required punch profile in a special workplane. Adjust points are provided to facilitate the positioning of the punch tool on the workpiece.
For English, the LISP based functions defining these parametric punch tool entities are included in the following file:
If you want to create customized functions for your own parametric punch tools, create a working copy of this file. Use a name such as my_punch_func.lsp for this file.
The appropriate function must be referenced in the :PROF_FNC column of the tool which it defines. Creo Elements/Direct Sheet Metal provides input to this function in the form of all tool table entries for the selected tool type as well as the sheet thickness and the current Creo Elements/Direct Modeling resolution. The function returns output in the form of the resulting profile created in the punch tool workplane.
Creo Elements/Direct Sheet Metal uses this data to build the distance checking zones which are displayed around the punch tool before it is placed on the sheet metal part. Once the user has positioned the tool, Creo Elements/Direct Sheet Metal uses the profile to mill the selected sheet metal part. The milling depth is usually equal to the sheet metal thickness. Creo Elements/Direct Sheet Metal uses the resulting cutout to build the punch feature information.
Please note that the LISP function files are not case-sensitive.
Structure of a Parametric Punch Tool Type Definition
The Creo Elements/Direct Sheet Metal punch tool structure is built upon LISP package definitions and punch tool functions.
LISP Package Definitions
The sample sha_punch_functions.lsp file supplied with Creo Elements/Direct Sheet Metal provides functions for the sheet-advisor package. It uses other functions provided through the open-lisp-interface (oli) package of Creo Elements/Direct Modeling.
• (in-package :sheet-advisor)
• (use-package :oli)
Functions
• The function defined for each punch tool in the sample sha_punch_functions.lsp file must be specified in the :PROF_FNC column of the tool table to which it belongs. By convention, the function name starts with sha- and ends with -profile to identify a function in the Creo Elements/Direct Sheet Metal (sha) package generating the tool profile.
defun sha-<function_name>-profile
• The function name declaration is followed by the tool parameters used by this function. The parameter names must match the column names specified in the tool table or the standard parameters :THICKNESS (sheet thickness) and/or :RESOLUTION (current system accuracy). The data for these parameters is taken from the columns of the associated TDB table. For instance, if parameter_1 is defined as slot_length, the applicable dimensions are taken from the slot_length column of the associated tool table. The &allow-other-keys statement deals with any other parameters which are not used by this function.
• The next block (starting with let) defines the standard local variables:
◦ result
Used as a return value.
◦ tool-wp
The name of the workplane where the punch profile will be created. The actual name is supplied by the sha-tool-wp function. The tool-wp statement provides the name of the workplane in which the punch tool profile will be positioned.
• The next block creates adjust points. The central adjust point must be positioned at the origin (0,0). The other adjust points are positioned around the central adjust point.
• The resulting profile is extracted from the workplane through a special Creo Elements/Direct Sheet Metal function.
(setq result (sha-profile-of-wp tool-wp_(PPP
• The tool workplane is deleted.
(delete_3d (sha-absolute-name tool-wp))
• The result is set to the last LISP value (which serves as the return value).
result ) )
Parametric Punch Tool Example
The following section is an extract from the sample sha_punch_functions.lsp file supplied with Creo Elements/Direct Sheet Metal. It illustrates the usage of the function syntax discussed in the previous sections. This sample section defines the function for the Connector punch tool.
By using the sample shown in the previous section as a template, you can quickly create your own custom punch tool type. The following guided exercise shows you how to create and implement a triangular punch tool type.
This guided exercise comprises the following stages:
Stage 1: Create the Workplane plus Profile plus Adjust Points
Proceed as follows:
1. In your working copy of the sha_punch_functions.lsp file (such as my_punch_func.lsp), create a new tool type entry. The following sample generates a workplane plus the profile and the adjust points for a triangular punch tool.
Stage 4: Specify the New Tool Function in the sha_customize File
To ensure that your new tool function is loaded automatically when Creo Elements/Direct Sheet Metal starts, you need to specify the tool function in your sha_customize file.
For instance, if your customized tool function file is named my_punch_func.lsp, you need to append the following line to your sha_customize file:
Perform the following steps to test your new punch tool type:
1. Use one of the following methods to load your new punch tool type in Creo Elements/Direct Sheet Metal:
◦ Restart Creo Elements/Direct Sheet Metal
or
◦ If Creo Elements/Direct Sheet Metal is already running, click on the command line at the bottom of the Creo Elements/Direct Sheet Metal window and enter the following command to load the shop definition file:
(sha-tdb-load "my_shop.lsp")
2. In the Punch menu, select Triangle.
3. Click on Tools. The new triangular punch tools are now listed in a separate selection list.
4. Select and apply the triangular punch tool of your choice. The result of this operation should resemble the following example.
Figure 188. Figure 3. Triangular Punch Feature
5. Explore the resulting punch feature.
Non-Parametric Punch Tool Types
In addition to parametric punch tool types, a number of non-parametric punch tool types are provided for use at your discretion. A non-parametric tool is defined by a single parameter record. This implies that such a tool is available in a single size only.
If you want use any of these predefined non-parametric punch tools, declare its tool type in the "Punch Types" table in the shop definition file. Then add the associated tool table to the shop definition file. An illustrated example of the method is provided in
Adding a Non-Parametric Punch Tool and Type Entry below.
Alternatively, you can create your own non-parametric punch tools "from scratch". The method is described in the following section.
Adding a Non-Parametric Punch Tool and Type Entry
If you want to add a non-parametric punch tool type to your TDB, complete the following steps:
1. Use Creo Elements/Direct Modeling Create 2D commands or associated macro commands to create the profile of your new punch tool. Add points to this profile for use as adjust points.
2. Save the workplane plus profile in 3D Data format.
3. Add the new punch tool to your shop definition file.
For example, if you want to add a non-parametric punch tool of a new type named "snap-in slot", proceed as follows:
1. Create a tool profile such as the sample shown in the following figure. Make sure that the profile is centered around the origin (0,0) of the workplane.
Figure 189. Figure 4. Sample Profile for a Non-Parametric Punch Tool
2. Add points which can serve as adjust points. Refer to existing punch tools for useful adjust point positions.
3. Save your new tool in the default directory for Creo Elements/Direct Sheet Metal punch tools or in your own punch tool directory. The default directory is:
$INSTALLDIR/personality/SheetAdvisor/punch
Creo Elements/Direct Modeling loads the workplane and part information from the directories that are specified as search directories. To add a directory to the search directories, use the following syntax:
Specify a filename by which the tool is easily identified (for example: snap_slot.sdw). If the Top-Level Instance Files button in the File menu is switched off, Creo Elements/Direct Modeling will automatically create the associated .sdwc file along with the .sdw file. If this button is switched on, only a single file (.sdwc) is generated. You can use either method.
Alternatively, specify the full pathname for the file in which you want to save the workplane plus profile of your new punch tool. For example, if your name is Jane and you want to save the new tool file in your Home directory, specify a pathname plus filename such as:
/users/jane/snap_slot.sdw
4. In the "Punch Types" section of your shop definition file, add a definition string such as "Triangle" for the new punch tool type you want to add to your TDB.
5. At the bottom of the "punch tools" section in your shop definition file, add a definition table for your new punch tool. You can either create this table "from scratch" or you can copy and edit an existing punch tool table. A sample table is provided below. This table includes the Home directory path mentioned in the previous step.
The /users/jane/snap_slot.sdw statement for the Prof WP column is merely an example of a pathname for the file in which you saved your new tool workplane plus profile.
6. Make sure that the directory in which you store your new tool file is specified in your sha_customize file. If you save the new tool in the default punch tool directory, you do not need to specify the full pathname.
7. Optionally, you can test your new non-parametric punch tool. The general procedure is the same as described in
Stage 5: Test the New Punch Tool Type.