Summary
This article explains how to use the STOCKSIZE and STOCKCUTS functions in product formulas to
add support for stock cut-down products.
More Information
In an effort to make working with cut-down products easier, SWCS now support two functions,
STOCKSIZE and STOCKCUTS. These functions make it easy to write formulas that will determine the
stock product to use based on color, finished width and height and also to determine how much to
cut off, left and right side, of a stock product.
Setting up the data
To use these functions you must first setup a data file that contains the stock product information.
This data file must be supplied alongside your product file.
The data file is a tab-delimited text file with the following columns:
- Stock Item
- Color
- Minimum Width
- Maximum Width
- Minimum Height
- Maximum Height
Example Data
STK0001 WHITE 10 15 5 99
STK0002 WHITE 16 20 5 59
STK0003 WHITE 16 20 60 99
Using the STOCKSIZE function
Use the STOCKSIZE function to lookup and return the stock item to use based on the color, width
and height. The STOCKSIZE function will scan the data file and return the name of the stock item
that best fits the color, width and height restrictions. The syntax for using this function is
STOCKSIZE(<color>|<width>|<height>|<datafile>)
where
<color> is the color too lookup. This is usually a reference to an option in the product where the
user chooses the color. For example [Color].
<width> is the width to lookup. This is usually a reference to the finished width option in the
product. For example [Finished Width Dec].
<height> is the height to lookup. This is usually a reference to the height option in the product.
For example [Height].
<datafile> is the name of the data file that contains the stock lookup data. This is the file name
with extension. For example mydata.txt. Do not include the full path to the file and don't use
quotes around the name.
Example
STOCKSIZE([Color]|[Finished Width Dec]|[Height]|stockdata.txt)
Notes
- If a stock size cannot be found the function will return N/A.
- If the width being looked up falls within the range of two or more stock items, the stock item with the shortest width will be used.
Using the STOCKCUTS function
Use the STOCKCUTS function to calculate the amount to cut off the left and/or right side of the stock
item. The data used by the STOCKCUTS function is the same as that used by the STOCKSIZE
function. The syntax for using this function is
STOCKCUTS(<color>|<width>|<height>|<datafile>)
where the parameters are the same as the STOCKSIZE function.
Notes
- If a stock size cannot be found the function will return nothing.
Notes
- These functions are only available with SWCS version 4.2.430 with hot fix 817567 applied, or with SWCS version 4.2.441 or higher.
APPLIES TO
- Product Designer 4.2
- Solatech Window Covering Software 4.2