we are just beginners with City Engine and we would like to know if it's possible to compare the size (length and area) of two different shapes. We created a grid and assigned a name to each rectangle, and what we want the software do is to compare the length of the edge (scope.sx) of square A1 to the edge of square B1 (see the attached image) and if they are the same, delete the line between them.
In CityEngine, a 3D Model is generated by using 1 shape plus 1 cga rule. Thus, each shape produces 1 Model. In this process in CGA, the shapes can not communicate with each other or query information about other shapes.
Thus, the process you describe is not possible. Maybe will in future versions.
The metadata which 'spans across' multiple shapes must be fed in the form of attributes to each shape so it's assigned rule knows what to do.
You can use Python scripting to collect such data and set attributes ( or do it manually ).
The idea would be not that you change the CGA code, but you drive specific attributes via a Python script.
Steps: 1] generate the models once, with reports for your target values 2] get the reports via Python ( using the script based exporter ) 3] do the calculations with that info ( at the end of the script based export ) 4] write the resulting new attribute values to the shapes ( at the end of the script based export ) 5] re-generate the models again with the new attributes
The problem I see in your specific task is that you try to COMBINE shapes like this. This is not really possible in CityEngine.
If possible, try to do ALL PREPROCESSING in ArcGIS, then bring the clean geometries and attributes to CityEngine for the 3D Model generation based on those inputs. CityEngine was not designed for such analysis tasks.
I can give you a little test example which shows you a possible workflow of the above steps, but I guess you will not be satisfied with it for what you're searching.