在幾乎所有DCC軟件中均存在判斷表達(dá)——當(dāng)**條件滿足時抒钱,則執(zhí)行**命令
條件函數(shù) Condition Statements
if(//This condition is true)????????????????????????????? >Greater than????? >=Greater than or equals
{??????????????????????????????????????????????????????????????????????? < Less than????????? <= Less than or equals
??? //Run this code;??????????????????????????????????????????? == Equals???????????? != Does not equal
}??????????????????????????????????????????????????????????????????????? & And
???????????????????????????????????????????????????????????????????????? || Or
例如:
if(@ptnum>1000)
{
@Cd = {0,0,1};
}
如果點序號大于1000? 那么這些點序號大于1000的點顏色為藍(lán)
函數(shù)嵌套,如:
if(@ptnum>1000)
{
@Cd = {0,0,1};
????? if(@ptnum>1500&@ptnum<2000)
????? {
?????????? @Cd = (0,1,0)蜕依;
????? }
}
else
{
@Cd = {1,0,0}蚌卤;
}
第二個if成立的條件是建立在第一個if條件下的
條件語句的簡寫形式:
例如:
@Cd = @ptnum<24 ? {1,0,0}:{0,1,0};
即當(dāng)點數(shù)小于24時赎婚,我們將顏色設(shè)置為紅或者綠