If Statements

Main Help  Table of Contents  Previous  Next

       If statements are a condition on creating the parts. For instance, if you only want to create a part when you have pullouts in the cabinet, that would be a condition and you would need to use an if statement on the new line added. Each if statement can be combined with others to put even more conditions on a certain part. Use the ampersand & to separate if statements:

 

Part, (fl=y)&(fr=y):1,  Nailer,    2,   bw,   #NailerMat,   ,   40,  0

 

       The cabinet this applies to must be finished on the left and right for the Nailer to be used.

 

Part, (fl=y)|(fr=y):1,   Nailer,   2,    bw,   #NailerMat,   ,   40,  0

 

Symbols Used in If Statements

       The cabinet this applies to must be finished on one side, either the left or right for the Nailer to be used. Some symbols you may use are:

 

=equal to
>greater than
<less than
>=greater than or equal to
<=less than or equal to
<>not equal to
|OR (used between two or more if statements that means one must be true but not all)
&AND (used between two or more if statements that means all must be true)

 

IF ELSE statements

       'IF ELSE' statements are much like 'IF' statements. the only difference is

they have an extra semicolon followed by the 'Else' text

 

Set, (fl=y)&(lcb<=0): #trimL=#finbot:#trimL=.25            ,Finished Left Side

 

In this example, if the condition [(fl=y)&(lcb<=0)] is true, the the first setting is done [#trimL=#finbot], if the condtion is false then the second part of the statement is executed.[#trimL=.25]

 

SKIP statements

'SKIP' statements allow you to skip a number of lines in a part or price list.

 

Skip, (w>24):1

{

Line

Line

Line

}

 

All lines between the curly brackets will be skipped if the 'IF' statement is true.

 

DO statements

       'DO' statements allow you to do a number of lines in a parts or price list only

if the 'IF' statement is true. This is the reverse of the 'SKIP' statement.

 

DO, (h>30):1

{

Line

Line

Line

}

 

All lines between the curly brackets will be done if the 'IF' statement is true.

 

Do and Skip statements are being used in the grid more frequently to allow for ease of use. When a Do statement is used in combination with DisplaySet lines it allows the DisplaySet lines within the Do statement to be seen in the grid only if the Do or Skip statement is true.

 

END statements

'END' statements will end the file immediately when the 'IF' statement is true.

 

END, (D=36):1

 

All lines in the file after the 'END' line will be skipped.

 

If Statements on the 3 types of Lines in KCDw

 

Load, (w=24):box-top.prt                

This loads 'box-top.prt' only if width equals 24"

 

Set, (fr=y): #SideMaterial = 3/4 Finished Ply: #SideMaterial = 1/2 Interior Ply"

This sets '#SideMaterial' to '3/4 Finished Ply' when the Right Side is Finished and

to '1/2 Interior Ply' when unfinished.

 

Part, (fl=y)&(fr=y):1,      Nailer,        2,       bw,        #NailerMat,       ,      40,      0

The cabinet this applies to must be finished on the left and right for the Nailer to be used.

 

 

Main Help  Table of Contents  Previous  Next

Copyright © 2007 KCDw Software