Extended modules > Creo Elements/Direct Sheet Metal > Creo Elements/Direct Sheet Metal customization > Multi Unfold
  
Multi Unfold
The Multi Unfold command replaces the manual processing often required to create production ready documentation and thus offers a wide range of customization options.
This chapter refers to several examples in the shop database files, sha_demoshop.lsp and sha_demoshop_func.lsp.
This chapter discusses the following topics:
General option settings
Drawing option settings
Document option settings
Database options settings
Special production process definitions
Production processes
Automatic selection via relation table
Special production process settings
Temporary 3D modification options
2D modification options
Replacement macros
Early Macro
Late Macro
External post processing
General option settings
Define the general option settings in the shop file. There are three types:
Drawing option settings
Document option settings
Database options settings
Multi Unfold will use the general option settings when
You choose Multi Unfold > Definition > Interactive.
You choose Multi Unfold > Definition > Shop Settings and you have not specified any special process options. (Special options override the global option settings.)
Drawing option settings
Set 3D or 2D options that will be visible on the flat drawing.
For an example, see sha-define-shop-table "drawing-settings" in sha_demoshop.lsp.
* 
The Multi Unfold menu does not display the options shown in italics; you can only set them in the shop file.
:BOTH_SIDES
[t | nil] t= Draw both the selected base face and its opposite side in one drawing.
:BEND_LINE
[t | nil] t= Draw bend lines.
:TEXT_LABELS
[t | nil] t= Draw the text labels of features like PUNCH, STAMP, RELIEF, CORNER_RELIEF and BEND features. If nil, the value defaults to that in the sha_set_flat_show_labels function, usually in the defaults section of the shop file.
:STAMP_GEO
[ t | nil] t= Show stamps; nil= remove stamps before doing the flat drawing.
:PUNCH_GEO
[ t | nil] t= Show punched holes; nil= remove punches before doing the flat.
:REF_POINTS
[t | nil] t= Show reference points of used tools.
:MERGE
[t | nil] t= Merge geometry elements where possible (especially the elements to the left and right end of the bend zones).
:TOPPART_ONLY
[t | nil] t= Put drawing data into one TOP part only instead of the normal parts structure with an upside and a downside part.
:CONVERT_SPLINES
[t | nil] t= Convert splines in flat drawing to a set of lines and arcs. Set parameters of this conversion with the following invisible options, or override the internal function with your own conversion function. The function must return a list of strings that contains OSDD commands that do the conversion.
:SPLINE-MIN-RAD
[length] minimum arc radius in CONVERT_SPLINE in [mm]
:SPLINE-MAX-RAD
[length] maximum arc radius in CONVERT_SPLINE in [mm]
:SPLINE-MIN-LENGTH
[length] minimum length of elements in CONVERT_SPLINE in [mm]
:REPLACEMENTS
[t | nil] t= Run replacement macros. If nil, Creo Elements/Direct Modeling uses the shop table defaults, usually defined in the defaults section of the shop file. For example, (sha-enable-replacements), or(sha-disable-replacements). In addition, other specific replacement settings(sha-enable-relief-replacements), (sha-enable-corner-relief-replacement), (sha-enable-punch-replacement), (sha-enable-stamp-replacement)will be retained. An interactive switch of this value will switch all these settings.
:BEND_ALLOWANCE_SHOP
[t | nil] t= Use the shop settings allowance calculation.
:BEND_ALLOWANCE_FIXED
[number] k-factor for bend flat calculation (ANSI syntax: values 0-1)
:CONE_ALLOWANCE
[number] k-factor for conical bends (ANSI syntax: values 0-1)
:SHARP_BEND_RADIUS
[length] Set length of sharp bend radius in internal units [mm]
:POSTPROCESS
[t | nil] t= Start customer defined post process.
:MI
[t | nil] t= Produce MI file with flat drawing.
:DXF
[t | nil] t= Produce DXF file with flat drawing.
:DWG
[t | nil] t= Produce DWG file with flat drawing.
:IGES
[t | nil] t= Produce IGES file with flat drawing.
:TXT
[t | nil] t= Produce text file with flat drawing information.
:FILE
[t | nil] t= Produce selected output formats (global switch).
:OUTPUT_WP
[t | nil] t= Load produced flat drawing to workplane.
:OUTPUT_OSDD
[t | nil] t= Send produced flat drawing to a running OSDD program.
Document option settings
The document option specifies the contents of the HTML documents that describe the sheet metal part with its flat drawing. For an example, see sha-define-shop-table "documentation-settings" in sha_demoshop.lsp.
:HTML
[t | nil] t= Produce an HTML document for each process (interactive = one process).
:JPEG
[t | nil] t= Produce a JPEG image file from the selected sheet metal part and the flat drawing of each process.
:TIFF
[t | nil] t= Produce a TIFF image file of each process.
:VRML
[t | nil] t= Produce a VRML model of the selected 3D sheet metal part.
:ISO
[t | nil] t= Show the selected sheet metal part in an isometric view.
:DIM
[t | nil] t= Show the selected sheet metal part in a diametric view.
:FREE
[t | nil] t= Show the selected sheet metal part in actual viewing direction.
:ADD_3D_DOC
[t | nil] t= Produce (if it does not exist) a 3D unfolded model of the selected sheet metal part and integrate it into HTML documentation.
:ADD-TAB1
<list <list "string1" "string2"> <list "string3" "string4"> ...> or <function-symbol>. A list of double strings where each double string adds one row to the first table of the html document or a function-symbol of a function that produces such a list. See an example of the table below.
:ADD-TAB2
<list <list "string1" "string2" "string3"> <list "string4" "string5" "string6"> ...> or <function-symbol>. A list of triple strings where each triple string adds one row to the second table of the html document or a function-symbol of a function which produces such a list. For example, to insert data derived from the 3D model or the 2D flat drawing, a drawing settings option could be set to write these data to a global variable (3D) or to a file (2D) from which this function will read the data. See an example of the table below.
:2D-FLAT-MIN-TEXT-SIZE-PIX
Specify the minimum text size for documentation, including screenshots. The text size in all flat drawings will be at least the given size in pixels.
Table 1
Database drawing number (DB NR)
p1
Database element identifier (ELID)
PART
p1
PATH
"/p1"
MATERIAL
UST 1203
MATERIAL - NUMBER
9999-0344
Units
L = MM / A = DEG / M = G
THICKNESS in
1.25
Example rows of Table 2
BENDS
2
# Total number of bends
DIFF BENDS
2
# Number of different bends
FLAT WIDTH
40.0000
# Width of box enclosing the flat
PART WIDTH
32.2609
# Width of box enclosing the part
Database options settings
Specify the use of the DesignDataManagement (DM) or the ModelManager (MM) database in the shop file. For an example, see sha-define-shop-table "database-settings" in sha_demoshop.lsp.
:USEDB
[t | nil] t= send produced data to selected database
:DDM-ACTION
<string> string of macro commands sent to DM as the initialization sequence
:MM-ACTION
<string> string of commands sent to MM as the initialization sequence
:DB-PARAMS
<list <string> <string>> parameters to send to the database. Include none to all of the following:
("TMPDIR" "ELID" "PELID" "L_TAB" "STATION" "USER" "DR_NR" "THICKNESS" "MATERIAL")
:REF_GRP
["DB-PREF" | "DB-DREF"] "DB-PREF" = part reference; "DB-DREF" = drawing reference
:KEY-WORD
<string> database keyword for drawing number, such as "NAME"
Special production process definitions
Production processes
Automatic selection via relation table
Special production process settings
Production processes
In the sha-define-shop section of the shop file (see sha_demoshop.lsp for an example), use the keyword :PRODUCTION-PROCESSES to list your production processes.
For example,
:PRODUCTION-PROCESSES ("flame_cutting" "laser_cutting" "nibbling" "punching" "stamping" "bending" "welding")
Each name must refer to a table of the same name that specifies the process as a property list:
(sha-define-shop-table "production_process"
:keyword1 value1
:keyword2 value2
...
)
See Special production process settings below for more information.
The process relation table described in Automatic selection via relation table uses this name to build the process.
Automatic selection via relation table
Define a special relation table and a relation function to automate production processes for a part.
Define the table in the sha-define-shop section of the shop definition file (see an example in sha_demoshop.lsp) following the keyword :PROCESS-RELATIONS, for example,
:PROCESS-RELATIONS "process-relations".
Use the same name to create a shop table, for example, sha-define-shop-table "process-relations".
Fill this table with the shop parameters to be used with the function that selects the needed processes for a part. You will usually create relations based on material and thickness dependencies that imply the use of certain production processes.
For example:
(sha-define-shop-table "process_relations"
:COLUMNS
(:MATERIAL :MIN_THICK :MAX_THICK :PROCESSES)
:UNITS
(nil :mm :mm nil)
:CONTENTS
(
("UST 1203" 1.00 9 ("laser_cutting" "punching" "stamping" "bending" "welding"))
("UST 1203" 9 50 ("flame_cutting" "welding"))
)
:KEY (:MATERIAL :MIN_THICK :MAX_THICK)
)
Notice the relationship between thickness ranges of a material and the available processes for that range.
Define the function following the keyword :PROCESS-SELECTION-FNC, also in the sha-define-shop section of the shop definition file. For example, :PROCESS-SELECTION-FNC sh-needed-shop-processes. An example of such a function, sh-needed-shop-processes, is in the sha_demoshop_func.lsp file. Based on an analysis of the processes used in the part and the relation table, this function returns
a list of processes
a keyword indicating whether each process should be visible in the menu
a keyword indicating whether the process should be selected for production by default
For example:
((:process "Punching" :visible t :valid t) (:process "Stamping" :visible t :valid nil). . .)
Special production process settings
1. Define drawing and documentation settings for a production process to override the General option settings in a special process table.
2. Choose the name of the table from the list mentioned with keyword :PRODUCTION-PROCESSES, above.
* 
A special process table may include both drawing options and documentation options, but not database options (if specified, such options will be ignored).
For an example, see sha-define-shop-table "bending" in the sha_demoshop.lsp file.
Temporary 3D modification options
Create drawings and reports to reflect a specific state of production by defining external functions that may be called interactively or automatically in the Multi Unfold process. These functions make temporary changes to the part that are reversed upon completion of the process.
1. Define the 3D modification options following the keyword :EXTERNAL-OPTIONS in the sha-define-shop-table section of the shop definition file.
For example,
:EXTERNAL-OPTIONS
("chamfer-option"
"change-color"
)
; example for customer definable 3D data preparation
; example for customer definable 2D data preparation
2. Create a table for each option consisting of a property list (:keyword1 :value1 :keyword2 :value2 ...) that defines a menu entry, a set of parameters, and a function to execute the modifications.
An external function table may consist of the following parameters:
TITLE
<string> the title of the option button, shown in the Drawing dialog box under Info contents in the Multi Unfold dialog box.
INIT-STATE
[ t | nil] t= initial state of this variable (if not overwritten by global or special drawing option settings)
EVAL-WHEN
[t | nil] t= execute function listed at :FUNCTION when button is set (=true); nil= execute function when button is NIL
FUNCTION
<function-pointer> the function to be executed when Preview has been clicked, and according to the appropriate button state (t | nil)
OPTION-KEY
<:keyword> a keyword from the global or specific drawing setting options, defining the initial state of this button
DEPENDENCIES
[<property list> | nil] a list of keyword value pairs, indicating dependencies on other options that might be changed when this option is set interactively. For example, (:TOPPART_ONLY t) means: automatically set the :TOPPART_ONLY flag before executing this function.
* 
Defining multiple dependencies may result in conflicting conditions. If so, the last definition overrides any conflicts.
For an example, see sha-define-shop-table "chamfer-option" in the sha_demoshop.lsp.
2D modification options
To modify 2D flat data, like texts and bend lines, and special 2D representations of 3D elements, use Controlling the information output to the flat, replacing certain features by special 2D geometry, or use "Reference Points" "Merge Lines" "TOP part only" and "Convert Spline". You may also use :MACRO-EARLY and :MACRO-LATE to implement 2D modifications. The :MACRO-EARLY function(s) will be executed directly after any replacement function(s), while the :MACRO-LATE function(s) will be executed after all other functions (including internal options) have been executed.
Replacement macros
Early Macro
Late Macro
Replacement macros
Define PUNCH, STAMP, BEND, RELIEF and CORNER-RELIEF features in the shop database with the :REPLACEMENT-INFO keyword followed by a macro name and parameters. For example, :REPLACEMENT-INFO ("sha_rnd_crn_relief_repl {1}" :DIA).
The macros will apply the modifications to the part which will then be transferred to the 2D drawings. Although a macro may include any action, it usually operates only on the elements with the same feature-info, for example, replacing a simplified 3D representation with a 2D representation.
To complete the customization, add loading of your macro file to the file, personality/SheetAdvisor/replacement_fncs/sha_replacement_initialize.asc.
Early Macro
Define a :MACRO-EARLY entry in the shop file to create changes on the flat drawing independent of any replacement macros.
This macro will be executed directly after replacement macros; if there are none, it will be the first macro executed on the 2D flat data.
The definition must be in the sha-define-shop-table section of the shop database.
The syntax is:
:MACRO-EARLY {<string> | <list of strings> | <function-pointer returning a string or list of strings>}
For example,
:MACRO-EARLY sha-change-color-red.
Each string (whether defined directly or as a return value from a function) must contain a sequence of Creo Elements/Direct Annotation or Creo Elements/Direct Drafting commands to be executed on the flat drawing.
The :MACRO-EARLY keyword must appear in one of the property-list tables in the sha-define-shop-table section of the shop database. Property-list tables must be listed after the keyword :EXTERNAL-OPTIONS in the sha-define-shop section. See the sha_demoshop.lsp file for an example, and see sha_demoshop_func.lsp for an example of a function that produces a 2D command list, sha-change-color-red.
Late Macro
Define a :MACRO-LATE entry in the shop file to make final changes to the almost ready 2D data. :MACRO-LATE will be executed after all other macros. The definition must be in the sha-define-shop-table section of the shop database.
The syntax is: :MACRO-LATE {<string> | <list of strings> | <function-pointer returning a string or list of strings>}. For example, :MACRO-LATE "CHANGE_COLOR WHITE SELECT ALL CONFIRM END".
Each string (whether defined directly or as return value from a function) must contain a sequence of Creo Elements/Direct Annotation or Creo Elements/Direct Drafting commands to be executed on the flat drawing.
The :MACRO-LATE keyword must appear in one of the property-list tables in the sha-define-shop-table section of the shop database. Property-list tables must be listed after the keyword :EXTERNAL-OPTIONS in the sha-define-shop section. See the sha_demoshop.lsp file for an example, and see sha_demoshop_func.lsp for an example of a function that produces a 2D command list, sha-change-color-red.
External post processing
To launch external post processing tasks, create processes to be launched either automatically or by the Postprocess button. For example, you may create a trigger for a follow-up workflow task, or call external programs to manipulate the data.
Post process functions
Post process addition of attributes
Post process functions
The SHA_MULTI_UNFOLD command provides two options, Interactive and Shop Settings, in the Definition menu. While the Shop Settings option defines many available processes, the Interactive option allows definition of only one process, that is, one flat drawing and one document.
The shop file contains the settings for each of the processes listed in Shop Settings. Use the Shop Settings option to execute all the processes automatically. Use the Interactive option until a shop version exists, for exceptions from the given processes, or to demonstrate the kinds of options available for each process. For the Interactive option, you may also create buttons to launch additional processes. Clicking Postprocess will display the buttons.
Define a postprocess function with the :POSTPROCESS-SETTINGS keyword followed by the name of the postprocess setting table in the sha-define-shop-table section of the shop file.
For example,
:POSTPROCESS-SETTINGS "postprocess-settings"
The postprocess settings table must contain a property-list with at least two entries: the :TITLE <string> to label the button in the menu and the :FUNCTION <function pointer> entry, the link to the user defined function. For example,
(sha-define-shop-table "postprocess-settings"

:TITLE "Postprocess"

:FUNCTION sha-shop-postprocess-function

)
The function takes a wide range of parameters. See the example, sha-shop-postprocess-function, in the sample file, sha_demoshop_func.lsp.
Start the postprocess functions interactively by clicking the Postprocess button in the menu. Automate them by adding the keyword value pair: :POSTPROCESS t to the table indicated by :DRAWING-SETTINGS (see example in sha_demoshop.lsp).
For an example of an interactive Postprocess function that defines buttons to launch additional processes, see sha_unfold_post_process_dialog in sha_demoshop.lsp.
Post process addition of attributes
To add attributes to the model that have been calculated during the flat creation, set the global variable, sheet-advisor::*sha-attribute-post-processing*. It will be checked and executed (if not nil) at the end of the MULTI_UNFOLD command. This variable must contain a list of double values, consisting of a function-pointer and a list of the appropriate parameters (see syntax for the LISP function, apply, in your LISP syntax reference). For an example, see sha_demoshop.lsp.
Examples of such attributes:
The weight of the body (which might be not exact in 3D because of stretching in the bend zones or simplified representation in 3D)
The flat size
The calculated cost