Slide background
Slide background

LRCZ Blog

Just another WordPress.com site

Eat drink and be merry

April 23, 2017

Have you ever had the rather annoying situation of a family composed out of a number shared subfamilies where you want to make an adjustment without editing the probably very complex family.

Just like exploding the family into its sub-parts…

Noname

Well, Dynamo to the rescue:

Capture.png

What’s happening here is that we collect the nested families, get their insert points and rotation, then recreate them.

The Python node at the end looks like this:

Noname.png

Thanks to Konrad Soborn – I had to get the script out of a custom node to get this to work

After running the script on a family it will be exploded into its sub-components

Noname

Life is good…

 

 

Posted in: Uncategorized

On Top With BIM

April 21, 2017

Just a pointer to a very interesting German-speaking BIM event:

E-Mail_Banner

When:

6/29 – 6/30 at Villa Blanka, Innsbruck

What (in German):
ON TOP WITH BIM ist ein Forum, gestaltet von BIM Experten für Führungskräfte.
Ziel des Forums ist die Lösung der Aufgaben bei der Einführung und Management von Building Information Modelling.
Kernpunkte:
• Stand der Technik: BIM
• Digitale Transformation der Immobilienbranche
• Veränderung der Berufsbilder
• Europäische und nationale Standards
• Executive und BIM
WEN SPRECHEN WIR AN?
Zielgruppe sind alle Führungskräfte in der Wertschöpfungskette der Immobilienbranche:
• Investoren
• Bauherren
• Betreiber
• Baumanagement
• Fachplaner
• Ausführende Unternehmen
ROI DES #OTWB
• Lernen Sie funktionierende BIM Workflows aus erster Hand
• Minimieren Sie Risiken bei der Einführung von BIM
• Maximieren Sie den ROI durch die Adaptierung
durchdachter Systeme.
• Treffen Sie die richtigen Personalentscheidungen
in Sachen BIM
• Entwicklung zukünftiger Standards

More info here.

Hope to see you there…

Posted in: Uncategorized

As easy as pie

April 13, 2017

You might know the annoying behavior – you run a Dynamo graph to – say – place families.

Noname

Then you rerun the graph a second time – it places the new families but deletes the old ones.

Noname

So – there is a new custom node in the LRCZ package – Elements.Bake

Noname

The node definition looks like this

Capture.png

What it basically does is it grabs the placed families, moves it 1 unit in z-direction, moves it then one unit in negative z-Direction and deletes all extraneous elements.

The trick is in the python code of the translation

Noname

Line 36 – holds the key:

elementlist.append(doc.GetElement(item).ToDSType(True))

With that iteration you ensure that your newly placed elements wont get deleted when rerunning the script.

Not all too elegant. But it works. And life is good…

Posted in: Uncategorized

The game is afoot

March 29, 2017

My friend Daniel Hurtubise pointed me to the Data Shapes package in Dynamo and I could not resist to try it – it’s really cool.

Noname

It basically enables you to build a User Interface for your Dynamo scripts. So here I have the graph:

Capture

This will allow you to select a box in Revit (in-place model, any category except Generic Model)

Noname.png

The script will then process every item of category Generic Model inside the box and write the name, article number and count into an Excel spreadsheet.

Noname

The fun part with Data-Shapes now is that we can make the selection process more interactive – here is the part of the graph where the good stuff happens:Noname

The result when firing up the script is:

Noname

Combine that with Dynamo player in Revit 2017 and you’ll have a slick professionally-looking add in.

Hi-res screenshot of the graph is here.

Credits go to Data|Shapes – you’ll find them here.

Life is good…

Posted in: Uncategorized

Look before you leap

February 26, 2017

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

Working weekend…

February 21, 2017

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

It’s been a while

February 5, 2017

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

The sound of silence

January 19, 2017

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

Go the whole hog

January 5, 2017

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

No rest for the wicked

January 5, 2017

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