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.
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?
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.
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…
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>" else: 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]”.
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.
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.