Browsed by
Category: ArcMAP

CityEngine to Lumion some more example renders Part 2

CityEngine to Lumion some more example renders Part 2

Following on from my previous post  I thought I’d post a few more example renders I’m working on.  I’m using the latest free Lumion version (2.5) testing out how big a model I can get away with from CityEngine.  As you can see it seems it can be quite big!

Modelling Utility Networks in CityEngine

Modelling Utility Networks in CityEngine

Updated 08/08/2012 : New image added this time with large Pylons and 4 cables

Just a quick note, I’ll post an example rule file later… basically you can model utility networks like electricity cables and pylons by using a graph network and instead of modelling a street with trees and lamps you model cables and pylons.

Large Pylons modelled using a Graph Network (added to post 08/08/2012)

In this example I’ve made sure the graph/street segment ‘y’ vertices are at a height of 12m (or whatever you like).  Then I’ve placed a pylon every 20 metres, which are offset down by 10m (so they sit on the ground and the cable rests on their arms).   Then at the same time drawn a simple black box down the centre line of the graph.   It’s crude I know but the results look quite good I think.

You could use this technique for anything, for example pipes/ducting underground.   Has anyone tried a road tunnel I wonder?

CityEngine Area Test Rule using Excel (free download)

CityEngine Area Test Rule using Excel (free download)

Further to my recent post on using Excel to create rules for CityEngine (CityEngine rule creation using Excel):

Attached for download below is a zipped up macro enabled Excel2007 file, hopefully it’s self explanatory but if not leave a comment below and I’ll try and help.   The basic premise is that you should be able to easily add and modify this file by using excel’s ability to drag and copy.   Have a play with it and if you like it can you let me know? Please Note: Every effort on my part has been made to ensure this has no virus or malware associated with it (I use Microsoft Security Essentials and Malwarebytes Anti-Malware), however please ensure that you do your part to and use an appropriate security scanner too. 

Cityengine Area Test Xlsm
Cityengine Area Test Xlsm
Version: 1
19.1 KiB
A CityEngine Project Update

A CityEngine Project Update

My CityEngine rules are really coming on now but I need time to think about how best to write the rules.   One thing I have started to learn is it’s really important to identify early on what attributes you want to control and which elements of the model you want to switch off.

You can use the case statement and an attribute with a true of false value to create that switch.   In practical terms it means you can fold many rule files into one, and at the flip of a switch reveal attributes that were previously hidden.

The example here shows my urban area (somewhere in a modern sub-division in the Middle East) in basic Google Earth style, but flip the on switch and the same model is now coloured according to a set of rules testing the lots area, red is too big, turquoise is near to the required lot size and green is within the lot area range I want.

Forget my choice of colour, this is a genuinely useful rule, being able to see what impact changes in the rule file are having is fantastic (but only if you’re a planner I suspect).

CityEngine’s power really comes when you see it as a design tool, it is by no means perfect but you can quickly set up a rule file and see the results of your ‘rules’ or planning standards very quickly.   What I hope is that ESRI allows ArcGIS to get some of CityEngine’s functionality, especially the dymanic street network capabilities of setting road and pavement widths…

I may put up a video showing just how quick this model refreshes itself… it’s interesting seeing how CityEngine runs the rule over you model colouring each model in turn…

A quick Python Label Expression in ArcGIS

A quick Python Label Expression in ArcGIS

Well I’ve been wanting to label certain features based on certain attributes (I  know exciting stuff), ArcGIS allows you to do this and until release 10 you were scripting this in VBScript.   Of course everyone is going Python now so I’m starting to use it…  The following is really a note for me to come back to, but it may help or interest others….

Right-click your layer you want to label, in the Layer Properties dialog box select the Labels Tab check Label features in this layer and click on the ” Expression Button”.   In the Label Expression dialog box select Python as the Parser and check the Advanced box.

Use this code:


def FindLabel ( [DistrictName], [QuarterCentre] ):
	if [QuarterCentre]:
		return  "<BOL><UND>"  + [DistrictName] + "</UND></BOL>"
		return [DistrictName]

Ensure you’ve tabbed everything as well, make sure you declare all the fields you want to use at the top. This basically checks the QauarterCentre field and if it has a value Bolds and Underlines the label.  Otherwise it just labels the feature.   To do the opposite you can use “if not [QuarterCentre]”.

For more information goto the ArcGIS 10.1 help here.

CityEngine rule creation using Excel

CityEngine rule creation using Excel

Okay I’m a planner so I use Excel a lot especially for population statistics and analysis of landuses and planning standards.   It would be nice to turn some of our planning standards tables into rule files for CityEngine to make.  For now though I’m trying out a number of workflows to test plot sizes.

What I wanted to do was choose the colours of my plots based on its area, this method allows me to pick a cell fill colour in Excel and run a macro over it to create the hex code which using the magic of CONCATENATE function creates the correct syntax.

The Excel sheet you see above can then be copied and pasted into a CGA rule file in CityEngine, the results below show that the colours I’ve choosen have come in well in CityEngine….

Why use this method?  Well I’m thinking of combining some of our data within CityEngine and this could be a handy way of doing it.   Here I can relatively easily copy additional test areas once and excel, using formulas, can create the rest of the rule file.

I’ll be posting a test Excel sheet soon here, as well as the macro code for take a cell fill colour and creating the hexadecimal code from it.

UPDATE(02/08/2012) You can download the Macro-Enabled Spreadsheet from this post.

I maybe here sometime…

I maybe here sometime…

Installing ArcGIS Basic the other day (after a massive download, 4GB over slowish ADSL!) I was presented with this install status screen…

I think I have time to make a cuppa yes? Reminds me of Hitchhikers Guide to the Galaxy and Deep Thought.

Note to self: ArcGIS hates Calibri! – garbled fonts in PDF exports

Note to self: ArcGIS hates Calibri! – garbled fonts in PDF exports

A real quick reminder to myself, you can’t use Calibri if you want to export your map as a PDF.

If you must use it you need to export all maps as an image (jpg, tiff etc…)

Otherwise your text will look like this:




Now have you learnt your lesson?