[042] Understanding case...else Conditional Rules in CityEngine CGA
Implement conditional decision-making in your procedural models using case...else statements and verify results with the color command. This tutorial explains the unique syntax requirements of conditional logic in CityEngine's CGA language. We discuss how to properly structure branching rules to avoid syntax errors, the necessity of the NIL command, and why placement within a rule matters. Additionally, we touch upon using the color command as a powerful tool for geometry selection verification. First, let's talk about `case...else`... As I mentioned in the earlier lectures, there are certain CGA commands that frequently travel together. Among them, one of the most common combinations is `index` used together with `case...else` statement. How case...else Differs from Traditional Programming Logic `case...else` acts like a signpost at a fork in the road when a condition is given for a variable or constant, classifying va...