Wednesday, December 23, 2015

DYNAMO FUMBLINGS

New years resolutions.  Let's have 3.  Exercise, music, dynamo.

Over the last year I lost 25kg and it has changed my outlook.  I achieved this mostly by a radical shift in diet, but to complete the transformation I need to settle into an exercise routine.  Wish me luck.

Music has been a big part of my life, but it's been a couple of years now since I had a band in Dubai and work has crowded out the blues.  Shouldn't be that way and that's another rhythm I have to re-establish.



Maybe Dynamo doesn't quite sit at the same level of fundamental life-balance, but it's something that's been on the back burner for more than 2 years now and another candidate for the "change of routine" strategy.

I made a start before leaving for Vegas, and I did a bit more last weekend. Nothing even remotely remarkable, and far from complete, but I want to record my process.

First off is a little exercise shamelessly copied from my good friend Marcello's work. He has shared a number of separate graphs dealing with text case changing.  I started with one of these and then built it out with alternative nodes at various points.  For different cases you have to switch 3 or 4 wired connections around, then press "run". 



I don't know if there is a cleverer way to do this.  It would be nice if you could just pick what you want to rename from a dropdown list and the rest of the rewiring just sorted itself out.  Oh, and you'd need to choose between upper and lower case also.

I've no idea whether this can be done with Dynamo.  Perhaps with some coded custom nodes ?  Doesn't really matter.  I don't even care if this turns out to be useful in real life or not.  I got my hands dirty and learnt some stuff, acquired a tiny bit of fluency.  It's a start.



The next exercise was spectacularly ambitious and I've barely scratched the surface, but once again it's all about the learning.  The starting point is a concept sketch I came up with for RTC Chicago - what if we could do automate these kind of Masterplanning calculations?

Baby step 1.  Create floor slabs from a bunch of property lines.  This turned out to be fairly easy.  There is a node for creating a floor based on 3 inputs.  Two of the inputs are single nodes (floor type & level)  The third input needed a sequence of 4.  Choose the element type (PropertyLine), Select all elements of that type,  gather up all the segments ("curves" in code-speak), join them up into a
PolyCurve.



That works, and if you change the property lines and run it again the floor slabs will update.  Magic.  Sadly if you close dynamo, or switch to another graph and come back to this one later it creates a new set of floors instead of modifying the existing ones. 

Probably there is a way around this.  Maybe you have to store the unique IDs somewhere.  It's way out of my league at present, so I just delete the old floors and start afresh.  I'm intrigued by the difference between repeating the operation in the same session and starting afresh in a new session though.  Food for thought.



Leave that there and switch to another aspect of the process.  Transfer parameters from one category to another so that maybe we can do calculations within a schedule.  I want the floors to inherit the plot numbers of the property lines.  Let's use Mark.  4 nodes will do to collect Mark parameters as a list.



Feed this output into the "value" field of a SetParameter node.  2 nodes to collect all the floors.  One node to choose "Mark" as the field to receive the input.  I was hoping to select only the floors of a named type, but I couldn't figure this out.  I'm sure it's easy when you know how, but so far it's defeated me.  Feel free to jump in and set me straight.  For now I'm happy to fix what I can and move on.



Make some changes to the property lines, press "run" and the floors pick up the new information.  But because I have 2 separate graphs for creating the floors and transferring parameters, when I add a new plot I have to go back, delete the floors, create them afresh using graph 1, then load graph 2 to transfer the parameters.  Baby steps, all good.



So the next piece of the puzzle is to collect several fields of data and shoot them out to excel for further processing.  That's probably the way we are going to get FAR and coverage calculations out of the model.  It would be great to do that directly in a Revit schedule, but I have my doubts.  The minute you put two buildings on one property things are going to get messy.

So I'm going to start very simply by gathering "mark" and "area" from a bunch of plots (property lines)  We've already done the "GetParameter" part of this.  Just double that up and feed the two sets of values into "index0" and "index1" of a "List.Create" node.  We need to "transpose" the result so that it becomes Rows and Columns instead of just a long sequence.



Then feed it into the "data" input of "Excel.WriteToFile"  You also need 3 nodes that I've organised as a "where to put the data" group.  Childishly simple stuff really, but it feels exciting first time around.  And up pops and Excel window with my first Dynamo-populated worksheet.  I added the headings manually, but it's quite easy to do that with Dynamo.  Found that in a handout by Nathan Miller.



To extend my test a bit I added some more plots and entered data in the "Comments" field.  This gives me a basis for colour-coding the floors using a view filter.  So the floors are giving me a representation of plots in 3 dimensional space, plus the ability to colour-code. You'd think that colour schemes would be available for Property Lines like they are for Rooms and Spaces but I don't see that happening any time soon, and in any case I want to see it in 3d so this method carries a lot of promise.



My excel graph now needs to collect 3 sets of parameters.  Only takes a minute or two to make that adjustment and now I have an Excel worksheet that looks a bit more useful.  Nathan's session at AU on Mining Data mentions Pivot Tables & Charts.  I was aware of these but had never really got around to mastering them, so that was fun. 



Final short exploration was to find a way for floors to detect which masses are sitting on top of them.  Later on we will need a way to line up area data from the masses with area data from the floors (plots) they sit on and do some calculations in excel.  Ideally we would set all this up, then just hit refresh every time the design has moved forward and get all these lovely tables with areas and Floor Area Ratios, Coverage percentages, Nos of parking spaces required, etc etc.  But first off is just to achieve some basic detection of masses by floors. 



I found a node called Geometry.DoesIntersect (GDI) this deals with Dynamo geometry so we have to collect that from Revit Elements.  I tested it first with manual selection.  Hit the select buttons and select a mass and a floor.  That returned a "true" result so I took it to the next level.



Select a bunch of floors and a bunch of masses, run them through the GDI and get a list of results.  This seems to work, but it's a long way from doing what I really want, which is to line up masses with the floors they sit on, transfer plot number information, add up values whenever 2 masses sit on one floor, filter out upper levels to get ground floor footprints and set up calculations that give mass footprint/plot area and mass GFA/plot area.  Brain hurty.  Give it a rest.

Starting to feel like I'm getting somewhere.  There's a very long way to go before the Masterplanning thing actually does the job.  Many dots to be joined up and probably a lot to learn about manipulating lists.  But I think that's OK for starters.  If I can set aside one weekend each month for some dynamo explorations like that, who knows where I can get to by the end of 2016? 



So that was mostly about manipulating data.  Maybe I should look at something a bit more geometric next time around.  Let's wait and see.


 

1 comment:

I've been getting a lot of spam so had to tighten up comments permissions. Sorry for any inconvenience. I do like to hear from real people