|
POST
|
Here is an excerpt from the help doc defining a string list. Stringlists are a series of strings stored inside one string. The elements are separated by a semicolon (";"). Each item must be followed by a semicolon, also the last one! The data type is "string", thus it is not an array as used in other scripting languages. listAdd You can either write the string list manually, import the data from somewhere else, write a python script to create the list, or compose it in CGA. In CGA, there are string list functions which may be helpful. For example, listAdd adds elements to a list. String concatenation using the + operator between two strings could also be used. Recursion may help to build the list. Here's a simple example on how to make a string list containing n random numbers in the range [0,100]. myList(n) =
case n==0:
""
else:
rint(rand(0,100)) + ";" + myList(n-1)
To get a list of 10 random numbers, you would do the following: myList(10)
... View more
06-20-2017
08:14 AM
|
0
|
0
|
778
|
|
POST
|
There is an example of a domed roof on top of the tower in the Sternwarte example. Help -> Download Tutorials and Examples.
... View more
06-20-2017
07:53 AM
|
0
|
0
|
4381
|
|
POST
|
I cannot reproduce the problem. Exporting after changing object attributes works for me. I started with the 5 object attributes in your screenshot and set different values for them for each building. I exported this to an spk (with one feature per shape), and the popups displayed the correct reported info. Then, I changed the object attributes Report.indoorLevels, Report.levels, and Report.name for one of the buildings, regenerated all models, and exported again to a new spk. The second export also worked, and the popups display the changed info for the changed building, and the other buildings are also correct. On the second export screen, sometimes you don't see the options. Just click Back once and then Next to get them to appear. Then, click finish. Did the simple example above work for you? Set the height to different values for each building. https://community.esri.com/message/687983-re-exporting-object-attributes-from-cityengine-to-scene-layer-package-problem?com…
... View more
06-17-2017
08:22 AM
|
0
|
0
|
3086
|
|
POST
|
When designing complex geometry, you have to decide if you can approximate it with pieces of primitives (cubes, spheres, cylinders, cones), or if it's just too complicated to make it looks good by combining a bunch of primitives or parts of primitives. primitive Operations In this case, since the geometry is complicated (i.e. I don't see an easy way to approximate it with primitives), I would recommend making the curvy roof part of the building in a 3D modeling software such as Maya, for example, and exporting it as an obj file, for example. Then, you could insert the asset in your roof rule using the i() operation. i Operation
... View more
06-17-2017
03:11 AM
|
1
|
3
|
1508
|
|
POST
|
Yes, it is possible to report different values for each room. You can do this with reports if you can calculate the values in the code. You can report the room height for example. It is also possible to export the room footprints to GDB, for example, and this automatically adds a unique object attribute called OBJECTID to each exported shape. In the GDB export (File -> Export Models -> Esri FileGDB), there are options to export object attributes and reports on each shape. report Operation
... View more
06-14-2017
02:06 AM
|
0
|
0
|
1509
|
|
POST
|
In the first piece of code, the score is actually being set in the rules, but it's only being set in the Mass rule. Attributes are initialized before any rules are executed, and these are the values that you see in the Inspector. So, score is set to 0 in the Inspector. Then, as we progress through the rules, we first come across Lot which generates a Mass shape in the shape tree. So, for the shape Lot and the shape Mass in the shape tree (to see the shape tree: Window -> Show Model Hierarchy), the value of score is 0. In the Mass rule, the attribute score is set to 1, 2, or 3, and so, for the shapes that come after Mass (in this case the implicit terminal shape which is also called Mass) the attribute score has a non-zero value, but this is something you don't see in the Inspector because it is a value that is set for only part of the shape tree. In the second piece of code, the syntax score = 1 is not allowed. This won't compile. I assume that the attributes height and area are getting values from linked object attributes, and that's why they are not zero. You can calculate score and volume when you define these attributes like this: attr score =
case height>area: 1
case height==area: 2
else: 3
attr volume = height*area The first approach is not wrong though. You could also set attributes values inside the rules. Just know that you won't see these values in the Inspector. This approach is helpful when you want to set different values on different parts of your model.
... View more
06-14-2017
01:45 AM
|
1
|
0
|
1008
|
|
POST
|
Yes, the street network would not be connected to the floor shape (for example, if you create the floor shape starting from a building footprint which has a building rule on it). However, you could also use the dynamic block shapes of the network as the room footprints instead of having separate floor shapes. The disadvantage of using the street networks is that they can't be created within a rule, so the building rule cannot create street networks. If you want to have a building rule that creates the appropriate building shape and floors, then I would try to stick with creating the walls with splits and other cga operations instead of using street networks. However, if you just need to make one floor plan, using the street networks to represent walls would be a good option.
... View more
06-14-2017
01:19 AM
|
0
|
0
|
1509
|
|
POST
|
No, you cannot create a graph network from within a rule that is applied to a shape. Graph networks can be drawn manually, imported from data, or grown procedurally (Graph -> Grow Streets). Then, from the edges and nodes, shapes are automatically created. These are dynamic shapes because if you move the network (edges or nodes), then the shapes move along with it. Creation of Shapes from Graph Networks For example, street shapes exist along the edges of the graph network. You cannot apply rules to the graph network directly, but you can apply rules to the street shapes. So, you could apply a wall rule, which could be as simple as Street --> extrude(wall_height), on the street shapes. Since there are a few different types of street shapes, you'll probably want to put your rule on shapes with start names Street, Joint, Crossing, Junction. You'll probably also want to set the sidewalk widths to 0 so that Sidewalk shapes are not generated. Street and Crossing Shapes
... View more
06-13-2017
06:28 AM
|
0
|
2
|
1509
|
|
POST
|
Yes, this is possible. You can write procedural rules for many interior items such as walls and furniture. You can also choose to insert assets for complex furniture. For example, you could partition space using the split operation to get walls between rooms. The offset, setback, shapeL, shapeU, and shapeO operations could also be helpful in dividing floors into rooms. Alternatively, the walls could be set up on a graph network, and a wall rule can be applied to the street shapes. Simple furniture such as tables and bookshelves can be made entirely procedurally, or at the other extreme, you can write rules that allow the user to choose from a set of complex assets. Furniture placement can also either be coded into the rules, or you can create individual initial shapes for each table and chair. By using procedural rules to generate the interior, there is the benefit of being able to change the model interactively. The user can pull on a handle to change the bookshelf dimensions, for example.
... View more
06-13-2017
05:54 AM
|
1
|
4
|
1509
|
|
POST
|
Yes, this should be possible using the split operation. You can split an extruded volume in the x, y, and z directions. split Operation For example, if you want to split into 3x3x3 volumes, you can do this: height = 10
floor_height = rint(height/3)
apt_width = rint(scope.sx/3)
apt_depth = rint(scope.sz/3)
Lot -->
extrude(height)
split(y) { ~floor_height: split(x) { ~apt_width: split(z) { ~apt_depth: Apt. }* }* }*
If you want to split into cubes with equal length sides, then you can set the split size to be an exact number (don't use the ~ sign in front). If you split into floors first and get the 2D floor footprint, you can use the splitArea operation to split into equal area parts (or into parts with specific area measurements). Then, from the 2D apartment footprint, you can extrude to get the volume back. splitArea Operation Other options for partitioning 2D space include: offset, setback, shapeL, shapeU, and shapeO. Then, extrude the 2D footprint by the floor height to get the 3D volume. offset Operation setback Operation shapeL, shapeU, shapeO operations
... View more
06-13-2017
05:12 AM
|
2
|
0
|
645
|
|
POST
|
The envelope is created on line 269 using parameters for the max height and setback values. The line before it prints these parameter values. My guess is that these parameter values are not correct. You can click on a shape that is not generating the model you want, and you can view the console output (Window -> Show Console) to see what these parameter values are for the problematic shapes. The max height value originally comes from the attributes value and aspect which seem to be lists that should probably come from linked object attributes. The values for these attributes are also printed in the console labeled as regulationAspect and regulationValue. You can also check (and edit) the object attributes on a shape in the Inspector under Object Attributes. If you create the object attributes, you'll probably also have to make the rule attributes visible (comment out the @Hidden annotation on lines 16 and 18) and connect the rule attributes to the object attributes (drop down arrow for rule attribute -> Connect Attribute).
... View more
06-12-2017
04:11 AM
|
0
|
0
|
912
|
|
POST
|
Instead of exporting as a CityEngine WebScene, you can export as a scene layer package (slpk) and publish the scene layer (right click on the file -> Share As -> Go to My Content which is the second icon in the navigator -> double click file -> on web page that opens click Publish -> go to published scene layer in My Content -> Open in Scene Viewer). The Scene Viewer, which displays the scene layer, allows for popups on individual buildings. These popups display reported values. So, you can customize what is in the popup by reporting the desired information. With CityEngine WebScenes, the object attributes and reported values on each building are displayed in the information panel. So, again, you can customize this by reporting the information you want to see in the panel. report Operation
... View more
06-08-2017
10:27 AM
|
0
|
0
|
464
|
|
POST
|
Tip: Use the Model Hierarchy (Window -> Show Model Hierarchy) to help you figure out what's going on in the rules. You can double click on shapes in the shape tree in the model hierarchy to jump to the corresponding rule in the rule file. First, the mass is split into a ground floor mass and an upper floor mass. Then, the comp happens on each of these masses to get the facades. This is in the rules GroundfloorMass and UpperfloorsMass, and the component splits are on lines 195-196 and 203-204. On line 195, change BlindFacadeGF to FacadeGF so that what happens to the back faces is the same as what happens to the other side faces. Similarly, on line 203, change BlindFacade to MainFacade("upper") so that the back faces match the side faces. With the model hierarchy open, click on the back face to see how it was generated, and follow the shapes up the tree until you get to a rule that you understand and back down the tree. Try to figure out why the back face is different from the front face. How is the texturing set up? The Floor rule (line 268) has a case statement which uses comp.sel=="back", so this causes back faces to be treated differently than other faces. Comment this line out (270). In the FacadeSets rule (line 226) the texture file is set on line 227 using gettexture. In the definition of gettexture, there's another case statement that tests if comp.sel=="back". Comment this out (line 130).
... View more
06-08-2017
09:14 AM
|
1
|
1
|
1022
|
|
POST
|
This is expected behavior. When exporting the graph network, only the nodes and edges of the graph are exported. Then, shapes for the streets, sidewalks, crossings, roundabouts, etc are generated dynamically from this graph. Rules are applied to shapes (and not graphs), so when a rule is applied to a street shape, the rule attributes are associated with the street shape. That's why exporting the street shapes gives you the rule attributes. Rules and rule attributes do not belong to graphs, so that's why they are not exported. If you just want to export (File -> Export) for use in another CityEngine scene, you can export to a scene file (.cej), and this preserves the rule attributes. You'll have your graph network with dynamically generated shapes with the desired rule attribute values.
... View more
06-07-2017
08:22 AM
|
1
|
2
|
814
|
|
POST
|
Esri.lib has a rule called Plant_Distributor.cga. You can use this rule to distribute plants on a shape. There are attributes that let you control the height range, the mix of species, the density, and the distribution. Maybe the attribute Distribution will help? Or, if you want to place plants according to a different distribution, you can write a rule that uses the Plant_Loader to insert the plant at your desired location. The scatter() operation might help in creating a uniform or gaussian distribution. scatter Operation
... View more
06-07-2017
08:10 AM
|
0
|
2
|
1789
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-14-2022 07:18 AM | |
| 1 | 06-22-2020 04:54 AM | |
| 1 | 02-17-2020 03:10 AM | |
| 1 | 07-03-2023 03:37 AM | |
| 1 | 06-07-2023 05:26 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-19-2023
12:40 PM
|