CFL has several functions that are not general purpose (as those above) but specific to layout of pages and signs on a roll or sheet. Though the calculation can be (and have been) done using the general formulas, these occur so often that CFL has special functions to manage them.
See Also cfl_function_-_calculatelayoutonsheet and cfl_function_-_calculatelayoutonroll.
In order to determine the optimal layout, Control must calculate the layout with both a portrait and landscape orientation. Each of these orientations is tiledTiling refers to putting multiple copies horizontally and vertically next to each other across the sheet. or paneledPaneling refers to splitting a copy across multiple sheets. if the items dimenstions are larger than the sheet dimensions. The total amount of material used for the required number of printsWe'll use prints to mean signs, copies, prints, or whatever is being produced. is calculated and the orientation with the minimum material usage (that also satisfies other requirements passed in) is chosen.
This concept, though simple, involves complex calculations that formerly took over 30 independent variables to compute and record. Hence, this function has been well received!
I would recommend experimenting on a new product while you are learning and avoid changing anything on your existing products until you are satisfied with your results.
One common mistake is also to forget the distinction between GetVariablePropertyValue and GetVariablePropertyText. The former must be used to pull number and yes/no values, while the latter must be used to pull text values.
We are going to create a basic layout here. There are some additional options to this function we won't explore in this How-To, but the names of the parameters and documentation at cfl_function_-_calculatelayoutonsheetshould be sufficient to help you refine it to your needs.
Notes:
CalculateLayoutOnSheet(
SheetLayout, // Variable to store the results in
ImageHeight, // Image Height
ImageWidth, // Image Width
Quantity, // Quantity
TwoSided, // Whether to print the (same) image on both sides
SheetHeight, // Sheet Height
SheetWidth, // Sheet Width
ImageGap, // Gap across the height (length) of the roll
ImageGap, // Gap across the width of the roll
PrintMargin, // Margin at the top of each print
PrintMargin, // Margin at the bottom of each print
PrintMargin, // Margin at the left side of each print
PrintMargin, // Margin at the right side of each print
0, // Margin at the top of each sheet
0, // Margin at the bottom of each sheet
0, // Margin at the left of each sheet
0, // Margin at the right of each sheet
0, // Overlap Amount - Amount of material to overlap when paneling
True, // Can Rotate - If true, calculate rotated and non-rotated to find optimal
True, // Can Tile - If true, calculate multiple across if they fit
True // Avoid Paneling - If true, always choose a non-paneled solution if possible
)
“Printing Material Layout”
+CHAR(13) + CHAR(10)
+CHAR(13) + CHAR(10)
+CHAR(13) + CHAR(10)+ “Is Rotated : ” + IF GetVariablePropertyValue(SheetLayout,“IsRotated”, False) THEN “Yes” ELSE “No” ENDIF
+CHAR(13) + CHAR(10)+ “Is Paneled : ” + IF GetVariablePropertyValue(SheetLayout,“IsPaneled”, False) THEN “Yes” ELSE “No” ENDIF
+CHAR(13) + CHAR(10)+ “Number Up : ” + GetVariablePropertyText(SheetLayout,“PrintsPerSheet”,“0”)*
+CHAR(13) + CHAR(10)+ “Number Wide : ” + GetVariablePropertyText(SheetLayout,“PrintsWide”,“0”)
+CHAR(13) + CHAR(10)+ “Number Height : ” + GetVariablePropertyText(SheetLayout,“PrintsHighPerPanel”,“0”)
+CHAR(13) + CHAR(10)
+CHAR(13) + CHAR(10)+ “ Printed Area = ” + DisplayVariableValue(PrintedTotalArea, -2)
+CHAR(13) + CHAR(10)+ “+ Scrap Area = ” + DisplayVariableValue(PrintedScrapArea, -2)
+CHAR(13) + CHAR(10)+ “= Total Area = ” + ToString( (PrintedTotalArea+PrintedScrapArea) In UnitArea, 2) + “ ” + UnitAreaName
+CHAR(13) + CHAR(10)
+CHAR(13) + CHAR(10)+ “= Sheets = ” + DisplayVariableValue(TotalSheets, -2)
+CHAR(13) + CHAR(10)
Hint: If you are just creating this for testing and don't want to bother with a polished Pricing form, or if you don't have Control Customizable, you can use the “Variable Grid” pricing form. This pricing form creates a grid of all of the variables in a product (arranged alphabetically) that you can use while you are testing and debugging.
A sample pricing form text is below (you can copy the text below and paste it into the “Advanced” tab in pricing form entry and then click the lightning button to generate it.
ImageHeight = 24, ImageWidth = 12, PrintMargin = 0 MaterialWidth = 48, MaterialHeight = 86, ImageGap = 0 Quantity = 100 Result: In this case, whether rotated or not, the image fits optimally with no wasted space.
Change ImageGap = 1 so that now we have spacing between the images. Result: Because of the additional spacing between prints, we can ….
ImageHeight = 22, ImageWidth = 28, PrintMargin = 0 MaterialWidth = 36, MaterialHeight = 48, ImageGap = 0 Quantity = 100 Result:
Some additional ways to expand the Layout functions include:
Contributor: Cyrious Software Date: 8/10/2009 Version: Control 4.2+