|
<< Click here to view the full document >> Export > Custom Exports |
Use Custom Exports to define and run your own data exports. To open it, select File > Export > Custom Exports or press Ctrl+E.
Custom Exports let you choose which data to export and how to arrange it, making it easier to exchange data with other systems or prepare files for production. You can use the supplied export definitions or adapt them to your needs. Creating or modifying export queries requires knowledge of SQL.
The supplied exports are ready to use: Plan to XML exports a cutting plan and its layouts to XML, while Layout parts, Plan stocks, and Material stocks export the corresponding data to CSV.
To restore a deleted or modified supplied export, click Refresh (the rightmost navigator button) and select its template. This creates a new custom export using the original SQL.

Export name
Name of the export. Exports with the same name run together when any one of them is run. When comparing export names, the program ignores // and everything after it.
Format
•xml (plan): Exports the cutting plan, including cutting layouts, to an XML file.
•csv: Exports the results of a custom SQL query to a CSV file.
Output file
Name of the output file. You can use the tokens listed below to generate the filename.
Run mode
•Manual: Runs when you click Run or press Ctrl+Enter.
•Manual in menu: Also makes the export available under File > Export.
•Auto after plan optim: Runs automatically after a plan is optimized.
•Auto after plan close: Runs automatically after a plan is closed.
•Auto after plan open: Runs automatically after a plan is opened.
Write mode
•Rewrite: Replaces the contents of the output file.
•Append: Adds the exported data to the end of the output file.
Blank line
Inserts an empty line between exported data blocks. Applies to CSV exports only.
Private
Makes the export visible only to the user who created it. Useful when multiple users share a network database.
Options
Run: Use to launch an external application or batch file. For example: Run=c:\mybatch.bat.
The following options apply to CSV exports:
Delimiter: Character used to separate fields.
Quote: Character used to enclose fields containing the delimiter. To enclose every field, enter the character twice, for example Quote="".
Header: Controls whether field names are included: 0 = no field names; 1 = included once; 2 = included with each appended data block.
BOM: Controls whether the file includes a byte order mark: 0 = omitted; 1 = included. Use 1 to help Excel recognize the file encoding and display accented characters correctly.
SQL
SQL query that selects the data to export. For example:
select * from Plans
You can also define fixed header and footer text using ExpHead and ExpFoot comments:
/* ExpHead
This is my constant header line 1.
This is my constant header line 2.
*/
/* ExpFoot
This is my constant footer line 1.
This is my constant footer line 2.
*/
select * from Plans
Tokens for the output filename
%docs% |
Standard export folder: C:\Users\<user>\Documents\CutLogic 2D\ |
%date% |
Current date in yyyy-mm-dd format |
%time% |
Current time in hh-nn-ss format |
To send the output to a physical or virtual serial port, enter COM in Output file. Configure the connection under Tools > Options > Serial port.
Tokens for the output filename and SQL query
These tokens refer to the currently selected record.
ActPlanID |
ID of the selected plan |
ActMatID |
ID of the selected material |
ActStorID |
ID of the selected storage |
ActAssemID |
ID of the selected assembly |
ActPlanNum |
Number (#) of the selected plan |
ActMatNum |
Number (#) of the selected material |
ActPlanDes1 |
Description of the selected plan |
ActMatDes1 |
Description of the selected material |
For stock or part, insert Part or Sou before ID, for example ActMatSouID or ActPlanPartID.
Tokens for SQL queries
ActPlanIDs |
IDs of all selected plans. |
ActIDs |
IDs of all selected records in the active list. |
Field-name suffixes for SQL queries
Add these suffixes to result column names or aliases to convert values from the internal database format to the format configured in CutLogic 2D.
•_l: Formats a length value. For example, part perimeter: select 2 * (Len + Wid) Perim_l from Parts
•_a: Formats an area value. For example: select Len * Wid Area_a from Parts
Functions
Click Export or press Ctrl+Enter to run the selected export.
Click Insert to insert a token into the SQL query.
Click Copy to copy the export result to the clipboard.
Custom Exports support multiple selected records. For example, if you select five plans and then run an export, all five plans are included.