Look before you leap

Dynamo time – getting in shape for the coming week. A clients wish was to be able to label Openings in Structural Framing by their distance from the floor slab above and the bottom of the beam. In cases there is no floor above, the upper value should show the distance from top of beam.

Obviously a common wish in certain regions. And it took us a while to get our heads around it. First trial was quite unsuccessful – the second attempt worked. So here is what is going on:

noname

The complexity is where the floor and beam join – Revit will return the un-joined geometry of the beam so simply analyzing it’s bounding box is not going to work.

Well, here is the completed graph and we’ll look at it step by step:

Capture.png

First, we need to collect the beams and slabs:

noname

Note that we immediately try to do a Boolean operation on the beam geometry in order to cut away the slab.

Next we collect all the openings – these are built in a way that there is a hidden BoundingBox geometry embedded in the family that gets its visibility  turned on to be able to gather its geometry – holes don’t have geometry…

noname

Next we collect the BoundingBox min and max values for their z-coordinates and calculate the result:

Noname.png

Then we wite the rsults into the opening families and turn the visibilty of the embedded BoundingBox off…

noname

Voila:

noname

Goal achieved – life is better… a high res picture of the graph is here.

 

Posted in Uncategorized | 1 Comment

Working weekend…

After a long working weekend building the program for BILT EUR 2017 – this is going to be an exciting conference, held in Aarhus from 5 – 7 October 2017.

header-banner_1440w_update

And if you want to see how we are doing this, see this video.

Posted in Uncategorized | 2 Comments

It’s been a while

Lots of work, lots of travel – so this blog went silent for a while but not for long anymore…

Achievements of the past couple of days/weeks:

Small stuff, cleanup work and trying to remoce custom node dependencies from my daily work Dynamo graphs. I foud myself too many times in odd places with my admittedly badly maintained tracel companion laptop missing packages so I just got rid of custom nodes for my two most often used nodes.

And here we have the first one:

ElemNamesToExcelNoCustomNodes – Using the Element Type selector we write stuff out to Excel

Capture.png

The fancy stuff is that we construct the Excel file name based on the file name and the Excel sheet name based on the Type.. but that is optional

The only “custom”thing here is this small Python script:

1.PNG

And that looks like this:

#Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

def ClearList(_list):
out = []
for _list1 in _list:
if _list1 is None:
continue
if isinstance(_list1, list):
_list1 = ClearList(_list1)
if not _list1:
continue
out.append(_list1)
return out

#Assign your output to the OUT variable
OUT = ClearList(IN[0])

BTW – ©Konrad K Soborn

So that writes the stuff out to Excel…

Using Dimension Type it produces a list like this in Excel..

1

Sure now we can use Reg exps in Excel to rename stuff..

1

The Excel now looks like this:

1

So now we hae this we need to suck that back into our Revit file – the Dynamo graph for that:

capture

Custom nodes that needed to be amended were:

1.PNG

So – from left to right the code is:

# Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

# Import DocumentManager
import clr
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager

import sys
pyt_path = r’C:\Program Files (x86)\IronPython 2.7\Lib’
sys.path.append(pyt_path)

#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

try:
    errorReport = None
    doc = DocumentManager.Instance.CurrentDBDocument
except:
    # if error accurs anywhere in the process catch it
    import traceback
    errorReport = traceback.format_exc()

#Assign your output to the OUT variable
if errorReport == None:
    OUT = doc
else:
    OUT = errorReport

Next one – middle one:

test = []
for i in IN[0]:
    test.append(int(i))
    
OUT = test

Then – on the right we have:

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

nameElems = []
for i in IN[0]:
    nameElems.append(UnwrapElement(i))
values = IN[1]

TransactionManager.Instance.EnsureInTransaction(doc)
for i, j in zip(nameElems, values):
    i.Name = j
TransactionManager.Instance.TransactionTaskDone()

#Assign your output to the OUT variable.
OUT = nameElems

And that is it – result:

1.PNG

Life is good..

 

Posted in Uncategorized | 2 Comments

The sound of silence

Nothing much happened here in terms of Dynamo during the last two weeks – workload with other projects, a new ISP, network completely rearranged, Revit Server fixed.. but then on a client’s request a little one: the challenge was to record the room names of every room a duct passes through into the duct element.

Which works like this:

capture

When we look at the model we see that ducts cross more than one room:

noname

Crucial to get the room information is this nodes from the SteamNodes package:

noname

Then we had to do some list management to be able to concatenate the room names and fed it back into one parameter:

noname

Now with just having the rooms we can concatenate the strings:

noname

And feed it against the duct elements collected here:

noname

Result:

noname

Again – life is good….

 

 

Posted in Uncategorized | 1 Comment

Go the whole hog

Another task – take a facade, count all instances of the various types of curtain panels, multiply the areas of the panels by their number and write this back into a parameter:

Capture.png

Here we are getting the panels:

noname

Here we do the math – (I found that code block):

noname

Here we write the values:

noname

Again – life is good…

Posted in Uncategorized | 1 Comment

No rest for the wicked

Nothing all too special today – task was parameter cleanup – moving values from one shared parameter in Revit to another one – here’s the graph:

capture

Trivial you may say, the interesting piece is that we avoid  typing the parameter name in a code block – we rather select it from a list to avoid typos:

noname

Goes to my big cleanup toolbox – life is good…

Posted in Uncategorized | 1 Comment

Ya tvoy slugá, ya tvoy rabótnik…

The more I do in Dynamo, the lazier I get. I just don’t want to manually fill out dozens of type parameter value in Revit when I can have that done in Excel. Especially when that is all string operations based on already existing parameter values.

So – first we dump the stuff into Excel:

Capture.png

 

Most of this graph has been discussed in earlier posts, the only real change is in getting the type parameter values:

noname

This produces:

noname

Now we can add values in the third column and use the following graph to write that back:

Capture.png

The only significant thing here is that we identify the elements by ID and then write the value back:

noname

Life is good again…

Scripts are here and here

And for anybody wondering where the title comes from: See at Youtube

 

Posted in Uncategorized | 1 Comment