Hello!
In my project I face a problem that, when I draw new streets and subdivide an existing block, new blocks do not take block parameters I have previously set. For instance, if I want to connect selected road segment on the left with the selected segment on the right, I will get two new blocks, which do not pick parameters of the block that is there now.
This is troublesome, because I am trying to set up a system where one can interactively create various urban block configurations in an area by editing and adjusting street network. The idea is that the buildings will be then automatically redrawn. The problem is that I rely not only on CGA script, but also on particular block parameters, 12 m offset split into 1 m wide lots, for the buildings generation.
Any suggestions how I can control the new blocks parameters? I am aware of Street Creation Settings dialogue, but I am only able to set the subdivision type and the rule file for new blocks there.
Petr
Solved! Go to Solution.
Hello Petr
Thanks for the response. I try to summarize:
If so, I'd recommend to make a small Python script that takes the selected block and sets your preferred values. You can attach the scripts in the GUI in the menu bar.
Kind regards
Pascal
hi .. I'm not sure if I don't follow..
can you make a step by step example ?
Matt
Hi Matt,
Thank you for responding. I will try to clarify.
My goal is to create a continuous building along the perimeter of an urban block. I begin with Offset Subdivision, which has offset width of 12m and InnerLot subdivision switched off.
Then I need to take care of existing buildings. My work-around for this problem is to draw exclusion zones around the existing buildings - the black rectangles under the buildings is my map layer. I set offset lots to be 1m wide and extrude the lots on the condition that the map layer is white under the lot. This way I get new building mass only in the areas that neither overlap with the existing buildings nor with the shades they cast.
So far so good. But having set up my mapping layer and CGA script, I want to to utilize Dynamic Street Layouts to interactively draw new streets. In my example, I want to draw a street across the urban block. This would allow me to have an interactive system of drawing and adjusting urban blocks.
I this point I have a problem:
I have two new blocks now, which have default settings for OffsetWidth, subdivisionRecursive and lotWidthMin. As I mentioned, I am able to set the subdivision type and the rule file for new blocks in Street Creation Settings, but not these parameters. So my system doesn't work.
How can I set OffsetWidth, subdivisionRecursive and lotWidthMin for the new blocks - can I hardcode it somehow?
Petr
Hi Petr
Impressive setup. Which version of CE are you using?
Thanks
Pascal
Hi Pascal,
Thank you! I am using 2014 version. Would you have any suggestions on how I can proceed?
I like the idea that with Dynamic City Layouts, I can interactively edit street network, while all building masses are instantly updated. However, to make that work for urban planning purposes, I would need to be able control the default settings for new urban blocks. Otherwise, there is an extra step: after each edit, I would need to go back to the parameters of the new blocks and set them up manually.
Petr
Hello Petr
Thanks for the response. I try to summarize:
If so, I'd recommend to make a small Python script that takes the selected block and sets your preferred values. You can attach the scripts in the GUI in the menu bar.
Kind regards
Pascal
Hello Pascal,
I have now been able to get back to the issue.
You are right that it is a bag: when I drew a new network in a new file, the blocks were 'picking up' parameters from surrounding blocks. That is good news.
I don't want to redraw my network, though, so I thought to try Python solution. Here is a script I made:
'''
Created on 26 August 2014
@author: Petr Bocharnikov
'''
from scripting import *
# get a CityEngine instance
ce = CE()
def blockParameters(offset, area, width):
selectedBlocks = ce.getObjectsFrom(ce.scene, ce.isBlock)
for block in selectedBlocks:
ce.setAttribute(blocks,'/ce/block/offsetWidth', 12)
ce.setAttribute(blocks,'/ce/block/subdivisionRecursive', False)
ce.setAttribute(blocks,'/ce/block/lotAreaMin', 12)
ce.setAttribute(blocks,'/ce/block/lotAreaMax', 12)
ce.setAttribute(blocks,'/ce/block/lotWidthMin', 1)
What do I need to add so that the script modifies the default block parameters? I am not sure how I can do that.
Petr
Hi Petr,
What is missing, does your script not work properly ?
Let me know ..
Matt